@font-face {
  font-family: "Patrick Hand";
  src: url("assets/fonts/PatrickHand-Regular.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "Kalam";
  src: url("assets/fonts/Kalam-Regular.ttf") format("truetype");
  font-display: swap;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  background: #fff;
}

.hero {
  height: 100svh;
  overflow: hidden;
  background: #fff;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 12vh;
}

.fridge {
  /* Standard top-freezer exterior width. Pieces on the door are sized in real inches. */
  --cabinet-in: 30;
  /* One light, from the upper left. Everything on the door casts the same way. */
  --cast-x: calc(0.018 / var(--cabinet-in) * 100cqi);
  --cast-y: calc(0.042 / var(--cabinet-in) * 100cqi);
  --cast-blur: calc(0.016 / var(--cabinet-in) * 100cqi);
  --cast-x2: calc(0.046 / var(--cabinet-in) * 100cqi);
  --cast-y2: calc(0.1 / var(--cabinet-in) * 100cqi);
  --cast-blur2: calc(0.12 / var(--cabinet-in) * 100cqi);
  container-type: inline-size;
  position: relative;
  width: min(78vw, calc(88svh * 432 / 368));
  aspect-ratio: 432 / 368;
  overflow: hidden;
}

.cabinet {
  display: block;
  width: 100%;
  height: auto;
}

/* The handles are cut from the same photo so they sit exactly over the cabinet.
   Anything dragged onto them paints underneath. */
.handle {
  position: absolute;
  left: calc(132 / 2160 * 100%);
  top: calc(244 / 2160 * 100cqi);
  width: calc(121 / 2160 * 100%);
  height: auto;
  z-index: 1000;
  pointer-events: none;
  user-select: none;
}

.fridge-item {
  position: absolute;
  display: block;
  height: auto;
  transform-origin: center center;
}

.photobooth {
  /* A printed strip is 2 inches wide. */
  z-index: 12;
  top: 24.16%;
  left: 58.74%;
  width: calc(2 / var(--cabinet-in) * 100cqi);
  transform: rotate(var(--rot, 6deg));
  filter:
    drop-shadow(var(--cast-x) var(--cast-y) var(--cast-blur) rgba(30, 30, 30, 0.38))
    drop-shadow(var(--cast-x2) var(--cast-y2) var(--cast-blur2) rgba(30, 30, 30, 0.16));
}

.piece {
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.polaroid {
  position: absolute;
  z-index: 6;
  left: 85.47%;
  top: 26.43%;
  /* Real Polaroid I-Type outer is about 3.5 × 4.2 inches. */
  width: calc(3.5 / var(--cabinet-in) * 100cqi);
  transform: rotate(var(--rot, -2.2deg));
  transform-origin: center center;
  filter:
    drop-shadow(var(--cast-x) var(--cast-y) var(--cast-blur) rgba(30, 24, 16, 0.34))
    drop-shadow(var(--cast-x2) var(--cast-y2) var(--cast-blur2) rgba(30, 24, 16, 0.14));
}

.puzzle {
  position: absolute;
  z-index: 7;
  left: 71.69%;
  top: 44.06%;
  width: calc(5.2 / var(--cabinet-in) * 100cqi);
  transform: rotate(var(--rot, 1.4deg));
  transform-origin: center center;
}

.puzzle-frame {
  /* Soft grab pad around the tiles — same warm cream as the scrap note. */
  padding: calc(0.1 / var(--cabinet-in) * 100cqi);
  border-radius: calc(0.08 / var(--cabinet-in) * 100cqi);
  background:
    url("assets/paper-grain.png") center / calc(0.85 / var(--cabinet-in) * 100cqi) repeat,
    linear-gradient(160deg, #fbf7ef 0%, #f3ebe0 100%);
  box-shadow:
    var(--cast-x) var(--cast-y) var(--cast-blur) rgba(30, 24, 16, 0.28),
    var(--cast-x2) var(--cast-y2) var(--cast-blur2) rgba(30, 24, 16, 0.12);
}

.puzzle-board {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: calc(0.09 / var(--cabinet-in) * 100cqi);
  aspect-ratio: 1;
  background: transparent;
}

.puzzle-tile {
  position: relative;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: calc(0.05 / var(--cabinet-in) * 100cqi);
  background-color: #d9dde0;
  background-image: url("assets/puzzle/dog.jpg?v=1");
  background-size: 300% 300%;
  background-repeat: no-repeat;
  cursor: pointer;
  touch-action: manipulation;
  /* Each square reads like its own little fridge magnet. */
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    inset 0 -1px 0 rgba(40, 30, 18, 0.12),
    0 1px 1px rgba(40, 30, 18, 0.22),
    0 2px 3px rgba(40, 30, 18, 0.12);
}

.puzzle-tile:focus-visible {
  outline: 2px solid #1a4fbf;
  outline-offset: 1px;
}

.puzzle-slot {
  border-radius: calc(0.05 / var(--cabinet-in) * 100cqi);
  background: rgba(40, 30, 18, 0.05);
  box-shadow: inset 0 1px 2px rgba(40, 30, 18, 0.1);
  pointer-events: none;
}

.puzzle-prize {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: calc(0.06 / var(--cabinet-in) * 100cqi);
  padding: calc(0.08 / var(--cabinet-in) * 100cqi);
  background:
    url("assets/paper-grain.png") center / calc(0.85 / var(--cabinet-in) * 100cqi) repeat,
    linear-gradient(160deg, #fbf7ef 0%, #f3ebe0 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    0 1px 1px rgba(40, 30, 18, 0.16);
}

.puzzle-prize img {
  display: block;
  width: 42%;
  height: auto;
  filter: drop-shadow(0 1px 1px rgba(30, 24, 16, 0.28));
}

.puzzle-prize p {
  margin: 0;
  font-family: "Kalam", "Patrick Hand", cursive;
  font-size: calc(0.28 / var(--cabinet-in) * 100cqi);
  line-height: 1.15;
  text-align: center;
  color: #3a3228;
  letter-spacing: 0.01em;
}

.puzzle-prize.is-reveal {
  animation: puzzle-prize-in 420ms cubic-bezier(0.2, 0.85, 0.3, 1.15) both;
}

@keyframes puzzle-prize-in {
  from {
    opacity: 0;
    transform: scale(0.72);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.puzzle.is-solved .puzzle-tile {
  pointer-events: none;
  cursor: default;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 1px 1px rgba(40, 30, 18, 0.16);
}

@media (prefers-reduced-motion: reduce) {
  .puzzle-prize.is-reveal {
    animation: none;
  }
}

.piece.is-held {
  cursor: grabbing;
}

.magnet {
  position: absolute;
  z-index: 20;
  height: calc(1.6 / var(--cabinet-in) * 100cqi);
  width: max-content;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  cursor: grab;
  touch-action: none;
  user-select: none;
  transform: rotate(var(--rot));
  transform-origin: center center;
  filter:
    drop-shadow(var(--cast-x) var(--cast-y) var(--cast-blur) rgba(20, 20, 20, 0.5))
    drop-shadow(var(--cast-x2) var(--cast-y2) var(--cast-blur2) rgba(20, 20, 20, 0.18));
}

.magnet img {
  display: block;
  height: 100%;
  width: auto;
  pointer-events: none;
  -webkit-user-drag: none;
}

.sketch {
  position: absolute;
  z-index: 3;
  left: 57.12%;
  top: 9.28%;
  width: calc(6.4 / var(--cabinet-in) * 100cqi);
  height: auto;
  transform: rotate(var(--rot, -2.4deg));
  transform-origin: center center;
  filter:
    drop-shadow(var(--cast-x) var(--cast-y) var(--cast-blur) rgba(30, 24, 16, 0.32))
    drop-shadow(var(--cast-x2) var(--cast-y2) var(--cast-blur2) rgba(30, 24, 16, 0.14));
}

.sfpl {
  position: absolute;
  z-index: 5;
  left: 68.13%;
  top: 24.56%;
  width: calc(3.4 / var(--cabinet-in) * 100cqi);
  height: auto;
  transform: rotate(var(--rot, 3.2deg));
  transform-origin: center center;
  /* Same upper-left light as every other fridge piece. */
  filter:
    drop-shadow(var(--cast-x) var(--cast-y) var(--cast-blur) rgba(30, 24, 16, 0.34))
    drop-shadow(var(--cast-x2) var(--cast-y2) var(--cast-blur2) rgba(30, 24, 16, 0.15));
}

.logo-sticker {
  position: absolute;
  z-index: 22;
  left: 44.57%;
  top: 7.04%;
  width: calc(3.5 / var(--cabinet-in) * 100cqi);
  height: auto;
  transform: rotate(var(--rot, -6deg));
  transform-origin: center center;
  filter:
    drop-shadow(var(--cast-x) var(--cast-y) var(--cast-blur) rgba(30, 24, 16, 0.34))
    drop-shadow(var(--cast-x2) var(--cast-y2) var(--cast-blur2) rgba(30, 24, 16, 0.15));
}

.muni-sticker {
  position: absolute;
  /* Stay under letter magnets (z 20+) so dragging never covers alphabet */
  z-index: 5;
  left: 12.87%;
  top: 61.97%;
  width: calc(3.6 / var(--cabinet-in) * 100cqi);
  height: auto;
  transform: rotate(var(--rot, 4deg));
  transform-origin: center center;
  filter:
    drop-shadow(var(--cast-x) var(--cast-y) var(--cast-blur) rgba(30, 24, 16, 0.34))
    drop-shadow(var(--cast-x2) var(--cast-y2) var(--cast-blur2) rgba(30, 24, 16, 0.15));
}

.moth-magnet {
  position: absolute;
  z-index: 8;
  left: 28.5%;
  top: 68.5%;
  width: calc(4.2 / var(--cabinet-in) * 100cqi);
  height: auto;
  transform: rotate(var(--rot, -7deg));
  transform-origin: center center;
  filter:
    drop-shadow(var(--cast-x) var(--cast-y) var(--cast-blur) rgba(20, 20, 20, 0.45))
    drop-shadow(var(--cast-x2) var(--cast-y2) var(--cast-blur2) rgba(20, 20, 20, 0.18));
}

.muni-metro {
  position: absolute;
  z-index: 7;
  left: 80.19%;
  top: 6.08%;
  width: calc(4.8 / var(--cabinet-in) * 100cqi);
  height: auto;
  transform: rotate(var(--rot, 0deg));
  transform-origin: center center;
  filter:
    drop-shadow(var(--cast-x) var(--cast-y) var(--cast-blur) rgba(30, 24, 16, 0.36))
    drop-shadow(var(--cast-x2) var(--cast-y2) var(--cast-blur2) rgba(30, 24, 16, 0.16));
}

.nov-cal {
  position: absolute;
  z-index: 8;
  left: 13.02%;
  top: 7.59%;
  width: calc(9.0 / var(--cabinet-in) * 100cqi);
  height: auto;
  transform: rotate(var(--rot, 0deg));
  transform-origin: center center;
  filter:
    drop-shadow(var(--cast-x) var(--cast-y) var(--cast-blur) rgba(30, 24, 16, 0.36))
    drop-shadow(var(--cast-x2) var(--cast-y2) var(--cast-blur2) rgba(30, 24, 16, 0.16));
}

.blueberries {
  position: absolute;
  z-index: 9;
  left: 45.85%;
  top: 24.33%;
  width: calc(3.2 / var(--cabinet-in) * 100cqi);
  height: auto;
  transform: rotate(var(--rot, 2.4deg));
  transform-origin: center center;
  /* Flat paper sheet on the door */
  filter:
    drop-shadow(var(--cast-x) var(--cast-y) var(--cast-blur) rgba(30, 24, 16, 0.28))
    drop-shadow(var(--cast-x2) var(--cast-y2) var(--cast-blur2) rgba(30, 24, 16, 0.12));
}

.tiny-horses {
  position: absolute;
  z-index: 9;
  left: 37.23%;
  top: 89.73%;
  width: calc(3.1 / var(--cabinet-in) * 100cqi);
  height: auto;
  transform: rotate(var(--rot, -5deg));
  transform-origin: center center;
  filter:
    drop-shadow(var(--cast-x) var(--cast-y) var(--cast-blur) rgba(30, 24, 16, 0.34))
    drop-shadow(var(--cast-x2) var(--cast-y2) var(--cast-blur2) rgba(30, 24, 16, 0.15));
}

.metal-magnet {
  position: absolute;
  z-index: 24;
  width: calc(0.58 / var(--cabinet-in) * 100cqi);
  height: auto;
  transform: rotate(var(--rot, 0deg));
  transform-origin: center center;
  filter:
    drop-shadow(var(--cast-x) var(--cast-y) var(--cast-blur) rgba(20, 20, 20, 0.4))
    drop-shadow(var(--cast-x2) var(--cast-y2) var(--cast-blur2) rgba(20, 20, 20, 0.16));
}

.book-pocket .metal-charm {
  position: absolute;
  z-index: 4;
  width: 20%;
  height: auto;
  transform: rotate(var(--rot, 0deg));
  transform-origin: center center;
  pointer-events: none;
  filter:
    drop-shadow(0.04rem 0.08rem 0.1rem rgba(20, 20, 20, 0.38))
    drop-shadow(0.01rem 0.02rem 0.04rem rgba(20, 20, 20, 0.18));
}

.star-frame {
  position: absolute;
  z-index: 18;
  left: 64.8%;
  top: 34.2%;
  width: calc(3.2 / var(--cabinet-in) * 100cqi);
  height: auto;
  transform: rotate(var(--rot, -6deg));
  transform-origin: center center;
  filter:
    drop-shadow(var(--cast-x) var(--cast-y) var(--cast-blur) rgba(30, 24, 16, 0.34))
    drop-shadow(var(--cast-x2) var(--cast-y2) var(--cast-blur2) rgba(30, 24, 16, 0.14));
}

.biz {
  position: absolute;
  /* Hangs in front of door stickers/photos; letters can still land above at rest. */
  z-index: 18;
  left: 44.1%;
  top: 47.07%;
  width: calc(3.5 / var(--cabinet-in) * 100cqi);
  /* The magnet is stuck to the door. The card hangs from it, almost plumb. */
  transform: rotate(var(--rot, -1.4deg));
  transform-origin: 50% calc(0.98 / var(--cabinet-in) * 100cqi);
}

.biz.is-held {
  z-index: 40;
}

.biz-clip {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 0;
  /* Jaw is the wide part of a front-facing clip, about 2.1 inches. */
  width: calc(2.15 / var(--cabinet-in) * 100cqi);
  height: auto;
  transform: translateX(-50%);
  pointer-events: none;
  /* Clip sits flush on the door. */
  filter:
    drop-shadow(var(--cast-x) var(--cast-y) var(--cast-blur) rgba(20, 20, 20, 0.42))
    drop-shadow(var(--cast-x2) var(--cast-y2) var(--cast-blur2) rgba(20, 20, 20, 0.16));
}

.biz-card {
  /* 671×772 clip. The jaws start about three quarters down and bite the card. */
  margin-top: calc(2.15 * 772 / 671 * 0.76 / var(--cabinet-in) * 100cqi);
  aspect-ratio: 3.5 / 2;
  background:
    url("assets/card-speckle.png") center / calc(0.28 / var(--cabinet-in) * 100cqi) repeat,
    linear-gradient(165deg, #d5cd86 0%, #c6bd72 48%, #b7ad62 100%);
  border-radius: calc(0.02 / var(--cabinet-in) * 100cqi);
  padding: 0 calc(0.18 / var(--cabinet-in) * 100cqi) 0 calc(0.2 / var(--cabinet-in) * 100cqi);
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: calc(0.14 / var(--cabinet-in) * 100cqi);
  /* Card is held off the door in the clip jaws — deeper cast than flush stickers. */
  box-shadow:
    calc(var(--cast-x) * 2.4) calc(var(--cast-y) * 2.6) calc(var(--cast-blur) * 1.8) rgba(30, 24, 16, 0.28),
    calc(var(--cast-x2) * 2.1) calc(var(--cast-y2) * 2.2) calc(var(--cast-blur2) * 1.35) rgba(30, 24, 16, 0.18),
    0 calc(0.08 / var(--cabinet-in) * 100cqi) calc(0.22 / var(--cabinet-in) * 100cqi) rgba(30, 24, 16, 0.12);
}

.biz.is-held .biz-card {
  box-shadow:
    calc(var(--cast-x) * 3.2) calc(var(--cast-y) * 3.4) calc(var(--cast-blur) * 2.2) rgba(30, 24, 16, 0.32),
    calc(var(--cast-x2) * 2.6) calc(var(--cast-y2) * 2.8) calc(var(--cast-blur2) * 1.5) rgba(30, 24, 16, 0.2),
    0 calc(0.12 / var(--cabinet-in) * 100cqi) calc(0.3 / var(--cabinet-in) * 100cqi) rgba(30, 24, 16, 0.14);
}

.biz-mark {
  flex: none;
  width: calc(0.46 / var(--cabinet-in) * 100cqi);
  height: calc(0.46 / var(--cabinet-in) * 100cqi);
}

.biz-studio {
  margin: 0;
  color: #56733c;
  font-family: "Gill Sans", "Avenir Next", "Trebuchet MS", sans-serif;
  font-size: calc(0.2 / var(--cabinet-in) * 100cqi);
  font-weight: 500;
  letter-spacing: 0.005em;
  line-height: 1.05;
  white-space: nowrap;
}

.about-only {
  position: absolute;
  visibility: hidden;
  pointer-events: none;
}

.fridge.is-about .magnet.about-only {
  visibility: visible;
  pointer-events: auto;
}

.fridge.is-about[data-frame="about"] .about-photo,
.fridge.is-about[data-frame="about"] .about-star,
.fridge.is-about[data-frame="about"] .about-print,
.fridge.is-about[data-frame="about"] .about-postcard {
  visibility: visible;
  pointer-events: auto;
}

.touch-only {
  position: absolute;
  visibility: hidden;
  pointer-events: none;
}

.fridge.is-about[data-frame="touch"] .touch-only {
  visibility: visible;
  pointer-events: auto;
}

.books-only {
  position: absolute;
  visibility: hidden;
  pointer-events: none;
}

.fridge.is-about[data-frame="books"] .books-only {
  visibility: visible;
  pointer-events: auto;
}

.muni-only {
  position: absolute;
  visibility: hidden;
  pointer-events: none;
}

.fridge.is-about[data-frame="muni"] .muni-only {
  visibility: visible;
  pointer-events: auto;
}

.fridge.is-about[data-frame="muni"] .muni-again:not(.is-shown) {
  visibility: hidden;
  pointer-events: none;
}

.book-pocket {
  --pocket-ink: #2a4f8f;
  position: absolute;
  z-index: 6;
  width: calc(3.55 / var(--cabinet-in) * 100cqi);
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  cursor: grab;
  touch-action: none;
  user-select: none;
  transform: rotate(var(--rot, 0deg));
  transform-origin: center center;
  filter:
    drop-shadow(var(--cast-x) var(--cast-y) var(--cast-blur) rgba(30, 24, 16, 0.34))
    drop-shadow(var(--cast-x2) var(--cast-y2) var(--cast-blur2) rgba(30, 24, 16, 0.15));
  transition:
    transform 220ms ease,
    filter 220ms ease;
}

.book-pocket.is-held,
.book-pocket.is-signing {
  z-index: 30;
  cursor: grabbing;
  filter:
    drop-shadow(0.16rem 0.36rem 0.48rem rgba(30, 24, 16, 0.4))
    drop-shadow(0.04rem 0.1rem 0.16rem rgba(30, 24, 16, 0.2));
}

.book-pocket.is-signing {
  cursor: default;
  transform: rotate(var(--rot, 0deg)) scale(1.1);
}

.book-pocket-card {
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  width: 100%;
  aspect-ratio: 5 / 7.4;
  padding: 0.32rem 0.3rem 0.24rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.28), transparent 24%),
    #f3eee3;
  border: 1px solid rgba(42, 79, 143, 0.32);
  border-radius: 0.04rem;
  color: var(--pocket-ink);
  text-align: left;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3);
}

.book-card-meta {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0 0.04rem 0.16rem;
  padding: 0.02rem 0.02rem 0.06rem;
}

.book-card-call,
.book-card-author,
.book-card-title {
  display: block;
  min-width: 0;
  font-family: "Courier New", Courier, monospace;
  font-size: calc(0.22 / var(--cabinet-in) * 100cqi);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.12;
  color: #111;
  overflow: hidden;
}

.book-card-call,
.book-card-author {
  white-space: nowrap;
  text-overflow: ellipsis;
}

.book-card-title {
  white-space: normal;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.book-card-grid {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  border-top: 1.5px solid rgba(42, 79, 143, 0.55);
}

.book-card-grid::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 36%;
  width: 1px;
  background: rgba(42, 79, 143, 0.5);
  pointer-events: none;
}

.book-card-grid-head {
  display: grid;
  grid-template-columns: 0.36fr 0.64fr;
  gap: 0;
  align-items: end;
  min-height: 0.78rem;
  padding: 0.1rem 0 0.08rem;
  border-bottom: 1.5px solid rgba(42, 79, 143, 0.55);
}

.book-card-label {
  min-width: 0;
  padding: 0 0.08rem;
  font-family: Helvetica, "Helvetica Neue", Arial, sans-serif;
  font-size: calc(0.175 / var(--cabinet-in) * 100cqi);
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.05;
  color: var(--pocket-ink);
  text-transform: uppercase;
  overflow: hidden;
}

.book-card-label.is-loaned {
  white-space: normal;
}

.book-card-label.is-borrower {
  white-space: nowrap;
}

.book-card-ledger {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

.book-card-ledger-row {
  display: grid;
  grid-template-columns: 0.36fr 0.64fr;
  align-items: end;
  min-height: 0;
  flex: 1 1 0;
  border-bottom: 1px solid rgba(42, 79, 143, 0.4);
}

.book-card-ledger-row.is-signing {
  background: rgba(255, 255, 255, 0.35);
}

.book-card-ledger-loaned,
.book-card-ledger-name {
  display: block;
  position: relative;
  min-width: 0;
  min-height: 0.7em;
  padding: 0 0.08rem 0.04rem;
  overflow: hidden;
  font-family: "Segoe Print", "Bradley Hand", "Comic Sans MS", cursive;
  font-size: calc(0.235 / var(--cabinet-in) * 100cqi);
  font-weight: 500;
  line-height: 1.05;
  color: #1a2748;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.book-card-ledger-name {
  font-size: calc(0.245 / var(--cabinet-in) * 100cqi);
}

.book-card-sign-input {
  position: absolute;
  inset: 0 0.05rem 0.02rem;
  width: calc(100% - 0.1rem);
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  font: inherit;
  color: inherit;
  outline: none;
  caret-color: #1a2748;
}

.book-magnet {
  position: absolute;
  z-index: 6;
  width: calc(1.55 / var(--cabinet-in) * 100cqi);
  height: auto;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  cursor: grab;
  transform: rotate(var(--rot, 0deg));
  transform-origin: center center;
  filter:
    drop-shadow(var(--cast-x) var(--cast-y) var(--cast-blur) rgba(30, 24, 16, 0.36))
    drop-shadow(var(--cast-x2) var(--cast-y2) var(--cast-blur2) rgba(30, 24, 16, 0.16));
  transition:
    transform 220ms ease,
    filter 220ms ease;
}

/* Children's picture book — wider/squatter than the trade paperbacks */
.book-magnet.is-picture {
  width: calc(1.95 / var(--cabinet-in) * 100cqi);
}

.book-magnet img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
  -webkit-user-drag: none;
}

/* Tap a book: it lifts off the door; a scrap label peeks out underneath */
.book-magnet.is-peek {
  z-index: 28;
  transform: rotate(var(--rot, 0deg)) scale(1.48) translateY(-8%);
  filter:
    drop-shadow(0.18rem 0.42rem 0.55rem rgba(30, 24, 16, 0.42))
    drop-shadow(0.05rem 0.12rem 0.18rem rgba(30, 24, 16, 0.22));
}

.book-peek-label {
  position: absolute;
  left: 50%;
  top: calc(100% - 0.15rem);
  z-index: -1;
  width: max-content;
  max-width: 7.2rem;
  padding: 0.38rem 0.48rem 0.42rem;
  border-radius: 0.08rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.35), transparent 42%),
    #f4efe4;
  color: #2a241c;
  font-family: "Patrick Hand", "Kalam", cursive;
  font-size: 0.72rem;
  line-height: 1.15;
  letter-spacing: 0.01em;
  text-align: left;
  white-space: normal;
  transform: translate(-50%, -30%) rotate(-3deg) scale(0.86);
  opacity: 0;
  pointer-events: none;
  box-shadow:
    0 0.08rem 0.16rem rgba(40, 30, 16, 0.18),
    0 0.02rem 0.04rem rgba(40, 30, 16, 0.1);
  transition:
    opacity 180ms ease,
    transform 220ms ease;
}

.book-peek-title,
.book-peek-author {
  display: block;
}

.book-peek-author {
  margin-top: 0.12rem;
  color: #6a5d4c;
  font-size: 0.64rem;
}

.book-magnet.is-peek .book-peek-label {
  opacity: 1;
  transform: translate(-50%, 0.2rem) rotate(-2.4deg) scale(1);
}

/* Paint-chip book cards — magnets are separate pieces (.book-clip-magnet) */
.book-chip {
  position: absolute;
  z-index: 6;
  width: calc(3.55 / var(--cabinet-in) * 100cqi);
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  cursor: grab;
  touch-action: none;
  user-select: none;
  transform: rotate(var(--rot, 0deg));
  transform-origin: center center;
  filter:
    drop-shadow(var(--cast-x) var(--cast-y) var(--cast-blur) rgba(30, 24, 16, 0.34))
    drop-shadow(var(--cast-x2) var(--cast-y2) var(--cast-blur2) rgba(30, 24, 16, 0.15));
}

.book-chip.is-picture {
  width: calc(3.75 / var(--cabinet-in) * 100cqi);
}

.book-chip-card {
  display: block;
  position: relative;
  width: 100%;
  padding: calc(0.18 / var(--cabinet-in) * 100cqi);
  padding-bottom: 0;
  background: #fff;
  border-radius: 0.04rem;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.8),
    inset 0 0 0 0.5px rgba(40, 30, 20, 0.06);
}

/*
  Paint-chip color field: tall rectangle with the FULL cover inset
  (correct aspect, never cropped). Dulled cover color fills around it.
*/
.book-chip-swatch {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 100%;
  aspect-ratio: 4 / 5;
  padding: 11% 13%;
  overflow: hidden;
  background: #c8bdb0;
}

.book-chip-cover {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center center;
  flex: 0 0 auto;
  pointer-events: none;
  -webkit-user-drag: none;
}

.book-chip-meta {
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
  min-height: calc(1.7 / var(--cabinet-in) * 100cqi);
  padding: 0.48rem 0.28rem 0.58rem;
  text-align: left;
  color: #111;
}

.book-chip-title,
.book-chip-author {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  font-family: Helvetica, "Helvetica Neue", Arial, sans-serif;
  letter-spacing: 0.02em;
  text-transform: none;
}

.book-chip-title {
  font-weight: 700;
  font-size: clamp(0.48rem, 1.35cqi, 0.68rem);
  line-height: 1.12;
}

.book-chip-author {
  font-weight: 400;
  font-size: clamp(0.4rem, 1.1cqi, 0.55rem);
  line-height: 1.12;
  color: #333;
}

.book-chip-word {
  display: block;
  white-space: nowrap;
}

.book-clip-magnet {
  position: absolute;
  z-index: 14;
  width: calc(1.05 / var(--cabinet-in) * 100cqi);
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  cursor: grab;
  touch-action: none;
  user-select: none;
  transform: rotate(var(--rot, 0deg));
  transform-origin: center center;
  filter:
    drop-shadow(0.06rem 0.12rem 0.18rem rgba(30, 24, 16, 0.38))
    drop-shadow(0.02rem 0.04rem 0.08rem rgba(30, 24, 16, 0.18));
}

.book-clip-magnet img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
  -webkit-user-drag: none;
}

/* Landscape photo print on a paint-chip card */
.photo-chip {
  position: absolute;
  z-index: 7;
  width: calc(7.2 / var(--cabinet-in) * 100cqi);
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  cursor: grab;
  touch-action: none;
  user-select: none;
  transform: rotate(var(--rot, 0deg));
  transform-origin: center center;
  filter:
    drop-shadow(var(--cast-x) var(--cast-y) var(--cast-blur) rgba(30, 24, 16, 0.34))
    drop-shadow(var(--cast-x2) var(--cast-y2) var(--cast-blur2) rgba(30, 24, 16, 0.15));
}

.photo-chip-card {
  display: block;
  width: 100%;
  padding: calc(0.28 / var(--cabinet-in) * 100cqi);
  background: #fbfaf7;
  border-radius: 0.08rem;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.65),
    inset 0 0 0 0.5px rgba(40, 30, 20, 0.08);
}

.photo-chip-swatch {
  display: block;
  width: 100%;
  aspect-ratio: var(--cover-ratio, 3 / 2);
  overflow: hidden;
  background: #ebe6dc;
}

.photo-chip-cover {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
  pointer-events: none;
  -webkit-user-drag: none;
}

@media (prefers-reduced-motion: reduce) {
  .book-magnet,
  .book-peek-label {
    transition: none;
  }
}

.whiteboard {
  z-index: 6;
  left: 68%;
  top: 34%;
  width: calc(10.5 / var(--cabinet-in) * 100cqi);
  height: calc(7.7 / var(--cabinet-in) * 100cqi);
  transform: rotate(var(--rot, -0.7deg));
  transform-origin: 30% 8%;
}

.whiteboard-frame {
  position: absolute;
  left: 0;
  top: 0;
  width: calc(10.5 / var(--cabinet-in) * 100cqi);
  height: calc(7.5 / var(--cabinet-in) * 100cqi);
  padding: calc(0.28 / var(--cabinet-in) * 100cqi);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0) 22%),
    linear-gradient(128deg, #f3f5f7 0%, #c5cbcf 34%, #eceff1 58%, #a7aeb4 100%);
  border-radius: calc(0.06 / var(--cabinet-in) * 100cqi);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 -1px 0 rgba(70, 78, 86, 0.45),
    var(--cast-x) var(--cast-y) var(--cast-blur) rgba(30, 24, 16, 0.34),
    var(--cast-x2) var(--cast-y2) var(--cast-blur2) rgba(30, 24, 16, 0.16);
}

.screw {
  position: absolute;
  width: calc(0.14 / var(--cabinet-in) * 100cqi);
  height: calc(0.14 / var(--cabinet-in) * 100cqi);
  border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, #f7f8f8, #9aa1a6 42%, #5e666c 78%);
  box-shadow:
    inset 0 0 0 1px rgba(40, 46, 52, 0.35),
    0 1px 0 rgba(255, 255, 255, 0.4);
  pointer-events: none;
}

.screw::after {
  content: "";
  position: absolute;
  left: 18%;
  right: 18%;
  top: 46%;
  height: 1px;
  background: rgba(30, 34, 38, 0.7);
  transform: rotate(-32deg);
}

.whiteboard-surface {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding:
    calc(0.28 / var(--cabinet-in) * 100cqi)
    calc(0.32 / var(--cabinet-in) * 100cqi)
    calc(0.2 / var(--cabinet-in) * 100cqi);
  background:
    url("assets/paper-grain.png"),
    linear-gradient(165deg, #fcfdfe 0%, #f4f6f8 70%, #e9eef2 100%);
  background-size: calc(0.9 / var(--cabinet-in) * 100cqi), auto;
  border-radius: calc(0.03 / var(--cabinet-in) * 100cqi);
  box-shadow:
    inset 0 0 0 1px rgba(150, 162, 174, 0.55),
    inset calc(0.04 / var(--cabinet-in) * 100cqi) calc(0.05 / var(--cabinet-in) * 100cqi) calc(0.14 / var(--cabinet-in) * 100cqi) rgba(70, 84, 100, 0.16);
}

.whiteboard-surface::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(112deg, rgba(255, 255, 255, 0.72) 0%, rgba(255, 255, 255, 0.12) 16%, rgba(255, 255, 255, 0) 34%);
  pointer-events: none;
}

.marker {
  position: relative;
  z-index: 1;
  font-family: "Kalam", "Patrick Hand", cursive;
  color: #1a4fbf;
}

.marker-prompt {
  margin: 0;
  font-size: calc(0.48 / var(--cabinet-in) * 100cqi);
  line-height: 1.05;
  transform: rotate(-0.4deg);
  transform-origin: 0 50%;
  user-select: none;
}

.marker-input {
  flex: 1;
  width: 100%;
  min-height: 0;
  margin: calc(0.12 / var(--cabinet-in) * 100cqi) 0 0;
  padding: 0;
  border: 0;
  resize: none;
  background: transparent;
  font-size: calc(0.4 / var(--cabinet-in) * 100cqi);
  line-height: 1.25;
  caret-color: #1a4fbf;
  cursor: text;
  user-select: text;
  -webkit-user-select: text;
  touch-action: auto;
}

.marker-input:focus {
  outline: none;
}

.whiteboard.is-inking .marker-input {
  caret-color: transparent;
}

.marker-status {
  min-height: 1.15em;
  margin: 0;
  padding-right: calc(0.72 / var(--cabinet-in) * 100cqi);
  font-size: calc(0.36 / var(--cabinet-in) * 100cqi);
  line-height: 1.1;
}

.marker-status.is-error {
  color: #c62828;
}

.marker-send {
  position: absolute;
  right: calc(0.22 / var(--cabinet-in) * 100cqi);
  bottom: calc(0.16 / var(--cabinet-in) * 100cqi);
  z-index: 2;
  width: calc(0.58 / var(--cabinet-in) * 100cqi);
  height: calc(0.58 / var(--cabinet-in) * 100cqi);
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: #1a4fbf;
  transform: rotate(-8deg);
  cursor: pointer;
  touch-action: auto;
}

.marker-send svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.marker-send svg path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.marker-send:hover {
  color: #163f99;
}

.marker-send:disabled {
  opacity: 0.55;
}

.clay-magnet {
  position: absolute;
  z-index: 14;
  width: calc(1.2 / var(--cabinet-in) * 100cqi);
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  transform: rotate(var(--rot, -4deg));
  transform-origin: center center;
  filter:
    drop-shadow(var(--cast-x) var(--cast-y) var(--cast-blur) rgba(30, 24, 16, 0.36))
    drop-shadow(var(--cast-x2) var(--cast-y2) var(--cast-blur2) rgba(30, 24, 16, 0.16));
}

.clay-magnet img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
}

.clay-magnet[data-id="linkedin"] {
  left: 15.74%;
  top: 4.7%;
}

.clay-magnet[data-id="instagram"] {
  left: 23.8%;
  top: 4.27%;
}

.clay-magnet[data-id="mail"] {
  left: 31.9%;
  top: 5.38%;
}

.magnet-cue {
  position: absolute;
  z-index: 80;
  transform: translate(-50%, calc(-100% - 0.55rem)) scale(0.96);
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  background: rgba(36, 28, 20, 0.88);
  color: #f7f1e6;
  font-family: "Segoe Print", "Bradley Hand", "Comic Sans MS", cursive;
  font-size: clamp(0.7rem, 1.35cqi, 0.85rem);
  letter-spacing: 0.01em;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 180ms ease, transform 180ms ease;
}

.magnet-cue.is-on {
  opacity: 1;
  transform: translate(-50%, calc(-100% - 0.75rem)) scale(1);
}

.postcard {
  z-index: 5;
  left: 62%;
  top: 36%;
  width: calc(6 / var(--cabinet-in) * 100cqi);
  transform: rotate(var(--rot, 1.6deg));
  transform-origin: center center;
  filter:
    drop-shadow(var(--cast-x) var(--cast-y) var(--cast-blur) rgba(30, 24, 16, 0.34))
    drop-shadow(var(--cast-x2) var(--cast-y2) var(--cast-blur2) rgba(30, 24, 16, 0.16));
}

.postcard img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
}

.tea-tin {
  z-index: 8;
  left: 20%;
  top: 48%;
  width: calc(3.35 / var(--cabinet-in) * 100cqi);
  transform: rotate(var(--rot, -5deg));
  transform-origin: center center;
  filter:
    drop-shadow(var(--cast-x) var(--cast-y) var(--cast-blur) rgba(30, 24, 16, 0.34))
    drop-shadow(var(--cast-x2) var(--cast-y2) var(--cast-blur2) rgba(30, 24, 16, 0.16));
}

.tea-tin.is-inking {
  z-index: 18;
}

.tea-tin.is-inking .whiteboard-pen {
  z-index: 3;
}

.tea-tin-face {
  display: block;
  position: relative;
  z-index: 2;
  width: 100%;
  height: auto;
  pointer-events: none;
  user-select: none;
}

.whiteboard-pen {
  position: absolute;
  z-index: 1;
  left: 36%;
  top: -68%;
  width: calc(0.48 / var(--cabinet-in) * 100cqi);
  height: auto;
  transform: rotate(-14deg);
  transform-origin: 47% 100%;
  pointer-events: none;
  transition:
    left 0.36s cubic-bezier(0.22, 0.8, 0.2, 1),
    top 0.36s cubic-bezier(0.22, 0.8, 0.2, 1),
    transform 0.36s cubic-bezier(0.22, 0.8, 0.2, 1);
  filter:
    drop-shadow(var(--cast-x) var(--cast-y) var(--cast-blur) rgba(20, 20, 20, 0.42))
    drop-shadow(var(--cast-x2) var(--cast-y2) var(--cast-blur2) rgba(20, 20, 20, 0.18));
}

.whiteboard-pen.is-inking {
  transition-duration: 0.07s;
}

.whiteboard-honey {
  position: absolute;
  left: -100%;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.about-photo {
  z-index: 5;
  left: 68%;
  top: 22%;
  width: calc(4.4 / var(--cabinet-in) * 100cqi);
  transform: rotate(var(--rot, -2deg));
  filter:
    drop-shadow(var(--cast-x) var(--cast-y) var(--cast-blur) rgba(30, 30, 30, 0.38))
    drop-shadow(var(--cast-x2) var(--cast-y2) var(--cast-blur2) rgba(30, 30, 30, 0.16));
}

.about-star {
  z-index: 16;
  left: 70%;
  top: 18%;
  width: calc(2.25 / var(--cabinet-in) * 100cqi);
  transform: rotate(var(--rot, 8deg));
  filter:
    drop-shadow(var(--cast-x) var(--cast-y) var(--cast-blur) rgba(20, 20, 20, 0.45))
    drop-shadow(var(--cast-x2) var(--cast-y2) var(--cast-blur2) rgba(20, 20, 20, 0.18));
}

.about-print {
  z-index: 6;
  left: 54%;
  top: 26%;
  /* Portrait letterpress print. */
  width: calc(5.8 / var(--cabinet-in) * 100cqi);
  height: auto;
  transform: rotate(var(--rot, 3.4deg));
  transform-origin: center center;
  filter:
    drop-shadow(var(--cast-x) var(--cast-y) var(--cast-blur) rgba(30, 24, 16, 0.34))
    drop-shadow(var(--cast-x2) var(--cast-y2) var(--cast-blur2) rgba(30, 24, 16, 0.14));
}

.about-postcard {
  z-index: 7;
  left: 38%;
  top: 54%;
  /* Landscape postcard print. */
  width: calc(5.6 / var(--cabinet-in) * 100cqi);
  height: auto;
  transform: rotate(var(--rot, -2.8deg));
  transform-origin: center center;
  filter:
    drop-shadow(var(--cast-x) var(--cast-y) var(--cast-blur) rgba(30, 24, 16, 0.34))
    drop-shadow(var(--cast-x2) var(--cast-y2) var(--cast-blur2) rgba(30, 24, 16, 0.14));
}

.muni-photo {
  z-index: 6;
  left: 18%;
  top: 22%;
  width: calc(12 / var(--cabinet-in) * 100cqi);
  margin: 0;
  padding: calc(0.22 / var(--cabinet-in) * 100cqi);
  border: 0;
  background: #f7f4ee;
  cursor: grab;
  transform: rotate(var(--rot, -1.6deg));
  transform-origin: center center;
  filter:
    drop-shadow(var(--cast-x) var(--cast-y) var(--cast-blur) rgba(30, 24, 16, 0.34))
    drop-shadow(var(--cast-x2) var(--cast-y2) var(--cast-blur2) rgba(30, 24, 16, 0.14));
}

.muni-photo img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
  -webkit-user-drag: none;
}

.muni-photo-pin {
  z-index: 18;
  left: 42%;
  top: 19.5%;
  width: calc(1.35 / var(--cabinet-in) * 100cqi);
  transform: rotate(var(--rot, 8deg));
  filter:
    drop-shadow(var(--cast-x) var(--cast-y) var(--cast-blur) rgba(20, 20, 20, 0.45))
    drop-shadow(var(--cast-x2) var(--cast-y2) var(--cast-blur2) rgba(20, 20, 20, 0.18));
}

.muni-hard-switch {
  z-index: 10;
  left: 78%;
  top: 24%;
  width: calc(2.4 / var(--cabinet-in) * 100cqi);
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  transform: rotate(var(--rot, 2.4deg));
  filter:
    drop-shadow(var(--cast-x) var(--cast-y) var(--cast-blur) rgba(30, 24, 16, 0.34))
    drop-shadow(var(--cast-x2) var(--cast-y2) var(--cast-blur2) rgba(30, 24, 16, 0.14));
}

.muni-hard-switch img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
}

.muni-again {
  z-index: 11;
  left: 72%;
  top: 58%;
  width: calc(3.2 / var(--cabinet-in) * 100cqi);
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  transform: rotate(var(--rot, -4deg));
  filter:
    drop-shadow(var(--cast-x) var(--cast-y) var(--cast-blur) rgba(30, 24, 16, 0.3))
    drop-shadow(var(--cast-x2) var(--cast-y2) var(--cast-blur2) rgba(30, 24, 16, 0.12));
}

.muni-again img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
}

.muni-board {
  z-index: 9;
  left: 16%;
  top: 52%;
  width: calc(18 / var(--cabinet-in) * 100cqi);
  min-height: calc(6 / var(--cabinet-in) * 100cqi);
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  transform: rotate(var(--rot, 0deg));
}

.muni-status {
  position: absolute;
  z-index: 12;
  left: 18%;
  top: 48%;
  margin: 0;
  max-width: 55%;
  font-family: "Segoe Print", "Bradley Hand", "Comic Sans MS", cursive;
  font-size: calc(0.32 / var(--cabinet-in) * 100cqi);
  line-height: 1.2;
  color: #3a3428;
  pointer-events: none;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}

.muni-choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: calc(0.35 / var(--cabinet-in) * 100cqi) calc(0.55 / var(--cabinet-in) * 100cqi);
  width: 100%;
  justify-items: center;
  align-items: start;
}

.muni-choice {
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  text-align: center;
  transform: rotate(var(--rot, 0deg));
  transform-origin: center center;
  filter:
    drop-shadow(var(--cast-x) var(--cast-y) var(--cast-blur) rgba(20, 20, 20, 0.45))
    drop-shadow(var(--cast-x2) var(--cast-y2) var(--cast-blur2) rgba(20, 20, 20, 0.16));
}

.muni-choice:disabled {
  cursor: default;
}

.muni-choice-enamel {
  --size: calc(2.7 / var(--cabinet-in) * 100cqi);
  --ring: calc(0.28 / var(--cabinet-in) * 100cqi);
  --rim: calc(0.08 / var(--cabinet-in) * 100cqi);
  position: relative;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  width: var(--size);
  height: var(--size);
  padding: calc(0.32 / var(--cabinet-in) * 100cqi);
  border-radius: 50%;
  border: var(--ring) solid var(--line, #555);
  background:
    radial-gradient(circle at 34% 30%, #ffffff 0%, #f8f7f4 52%, #efeee9 100%);
  box-shadow:
    0 0 0 var(--rim) #e8e3da,
    0 0 0 calc(var(--rim) + 0.05 / var(--cabinet-in) * 100cqi) #9a958c,
    0 0 0 calc(var(--rim) + 0.1 / var(--cabinet-in) * 100cqi) #f0ebe3,
    inset 0 0 0 1px rgba(0, 0, 0, 0.12),
    inset 0 1px 1px rgba(255, 255, 255, 0.9),
    inset 0 -1px 2px rgba(0, 0, 0, 0.06);
}

.muni-choice-face {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: calc(0.04 / var(--cabinet-in) * 100cqi);
  width: 100%;
  max-width: 88%;
  text-align: center;
}

.muni-choice-line {
  display: block;
  font-family: Helvetica, "Helvetica Neue", Arial, sans-serif;
  font-size: calc(0.82 / var(--cabinet-in) * 100cqi);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 0.88;
  color: var(--line, #555);
}

.muni-choice-name {
  display: block;
  font-family: Helvetica, "Helvetica Neue", Arial, sans-serif;
  font-size: calc(0.18 / var(--cabinet-in) * 100cqi);
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1.02;
  text-transform: uppercase;
  color: #111;
}

.muni-choice.is-correct .muni-choice-enamel {
  box-shadow:
    0 0 0 var(--rim) #d9d4cb,
    0 0 0 calc(var(--rim) + 0.06 / var(--cabinet-in) * 100cqi) #8f8a81,
    0 0 0 calc(var(--rim) + 0.11 / var(--cabinet-in) * 100cqi) #ebe6dd,
    inset 0 1px 1px rgba(255, 255, 255, 0.85),
    inset 0 -1px 2px rgba(0, 0, 0, 0.08),
    0 0 0 calc(0.18 / var(--cabinet-in) * 100cqi) #2f7a3e;
}

.muni-choice.is-wrong {
  opacity: 0.72;
  filter:
    grayscale(0.25)
    drop-shadow(var(--cast-x) var(--cast-y) var(--cast-blur) rgba(20, 20, 20, 0.35));
}

.muni-choice.is-wrong .muni-choice-enamel {
  box-shadow:
    0 0 0 var(--rim) #d9d4cb,
    0 0 0 calc(var(--rim) + 0.06 / var(--cabinet-in) * 100cqi) #8f8a81,
    0 0 0 calc(var(--rim) + 0.11 / var(--cabinet-in) * 100cqi) #ebe6dd,
    inset 0 1px 1px rgba(255, 255, 255, 0.85),
    inset 0 -1px 2px rgba(0, 0, 0, 0.08),
    0 0 0 calc(0.18 / var(--cabinet-in) * 100cqi) #a33b3b;
}

.muni-hard {
  display: flex;
  flex-direction: column;
  gap: calc(0.45 / var(--cabinet-in) * 100cqi);
  width: 100%;
}

.muni-line-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: calc(0.22 / var(--cabinet-in) * 100cqi);
}

.muni-line-magnet {
  display: grid;
  place-items: center;
  width: auto;
  height: calc(1.7 / var(--cabinet-in) * 100cqi);
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  transform: rotate(var(--rot, -2deg));
  filter:
    drop-shadow(var(--cast-x) var(--cast-y) var(--cast-blur) rgba(20, 20, 20, 0.5))
    drop-shadow(var(--cast-x2) var(--cast-y2) var(--cast-blur2) rgba(20, 20, 20, 0.18));
}

.muni-line-magnet img {
  display: block;
  height: 100%;
  width: auto;
  pointer-events: none;
  -webkit-user-drag: none;
}

.muni-line-magnet.is-selected {
  filter:
    drop-shadow(0 0 0.05rem #1a1a1a)
    drop-shadow(var(--cast-x) var(--cast-y) var(--cast-blur) rgba(20, 20, 20, 0.55))
    drop-shadow(var(--cast-x2) var(--cast-y2) var(--cast-blur2) rgba(20, 20, 20, 0.2));
  transform: rotate(var(--rot, -2deg)) translateY(-0.12rem) scale(1.08);
}

.muni-wordle {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
}

.muni-wordle-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.14rem;
}

.muni-tile {
  display: inline-grid;
  place-items: center;
  width: clamp(0.72rem, calc(0.95 / var(--cabinet-in) * 100cqi), 1.15rem);
  height: clamp(0.85rem, calc(1.1 / var(--cabinet-in) * 100cqi), 1.3rem);
  border-radius: 0.18rem;
  border: 1px solid rgba(40, 34, 28, 0.2);
  background: #f3eee3;
  font-family: Helvetica, "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(0.5rem, calc(0.55 / var(--cabinet-in) * 100cqi), 0.68rem);
  font-weight: 700;
  color: #241f1a;
  box-shadow: 0.04rem 0.08rem 0.1rem rgba(30, 24, 16, 0.18);
}

.muni-tile[data-state="filled"] {
  background: #efe8da;
}

.muni-tile[data-state="correct"] {
  background: #5a9a62;
  color: #fff;
  border-color: #3f7246;
}

.muni-tile[data-state="present"] {
  background: #d2b04a;
  color: #fff;
  border-color: #a88a2e;
}

.muni-tile[data-state="absent"] {
  background: #8a847a;
  color: #fff;
  border-color: #6c675e;
}

.muni-hard-hint {
  margin: 0.15rem 0 0;
  font-family: "Segoe Print", "Bradley Hand", "Comic Sans MS", cursive;
  font-size: calc(0.28 / var(--cabinet-in) * 100cqi);
  color: #4a4338;
}

.back-zone {
  position: absolute;
  z-index: 15;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.magnet.is-away {
  visibility: hidden;
  pointer-events: none;
}

.magnet.is-held {
  z-index: 21;
  cursor: grabbing;
  filter:
    drop-shadow(calc(var(--cast-x) * 1.6) calc(var(--cast-y) * 1.6) var(--cast-blur) rgba(20, 20, 20, 0.45))
    drop-shadow(calc(var(--cast-x2) * 1.7) calc(var(--cast-y2) * 1.7) var(--cast-blur2) rgba(20, 20, 20, 0.22));
}

.piece.is-wiped,
.piece.is-back {
  pointer-events: none;
  animation: fridge-wipe 0.46s steps(5, end) both;
}

.piece.is-back {
  animation-direction: reverse;
}

@keyframes fridge-wipe {
  0% { clip-path: inset(0 0 0 0); }
  100% { clip-path: inset(0 100% 0 0); }
}

@media (prefers-reduced-motion: reduce) {
  .piece.is-wiped,
  .piece.is-back,
  .whiteboard-pen {
    animation-duration: 0.01ms;
    transition-duration: 0.01ms;
  }
}

@media (max-width: 700px) {
  .hero {
    padding-top: 8vh;
  }

  .fridge {
    width: min(92vw, calc(88svh * 432 / 368));
  }

  .whiteboard {
    height: 44%;
  }

  .whiteboard-frame {
    width: 100%;
    height: 100%;
  }

  .marker-prompt,
  .marker-input,
  .marker-status {
    font-size: 16px;
  }

  .marker-send {
    width: 28px;
    height: 28px;
  }
}

/* ---------- The short version: a thermal receipt ---------- */
/* 80 mm thermal paper is about 3.1 inches wide. It hangs from a metal magnet,
   a little crumpled, the way a receipt looks after a day in a pocket. */
.receipt {
  --u: calc(1 / var(--cabinet-in) * 100cqi);
  position: absolute;
  z-index: 17;
  left: 88.4%;
  top: 43.6%;
  width: calc(3.1 * var(--u));
  transform: rotate(var(--rot, 2.2deg));
  transform-origin: 50% calc(0.25 * var(--u));
  transition: transform 520ms cubic-bezier(0.2, 0.8, 0.2, 1), filter 520ms ease;
  /* Crumpled paper stands a little off the door, so it casts a bit deeper than flat prints. */
  filter:
    drop-shadow(calc(var(--cast-x) * 1.6) calc(var(--cast-y) * 1.7) calc(var(--cast-blur) * 1.4) rgba(30, 24, 16, 0.3))
    drop-shadow(calc(var(--cast-x2) * 1.4) calc(var(--cast-y2) * 1.5) var(--cast-blur2) rgba(30, 24, 16, 0.14));
}

.receipt.is-held {
  z-index: 40;
}

.receipt-magnet {
  position: absolute;
  z-index: 3;
  left: 50%;
  top: calc(-0.12 * var(--u));
  width: calc(0.62 * var(--u));
  transform: translateX(-50%) rotate(-8deg);
  pointer-events: none;
  filter:
    drop-shadow(var(--cast-x) var(--cast-y) var(--cast-blur) rgba(20, 20, 20, 0.42))
    drop-shadow(var(--cast-x2) var(--cast-y2) var(--cast-blur2) rgba(20, 20, 20, 0.16));
}

.receipt-paper {
  /* Laid out once at a fixed size (300px = 3.1in), then scaled onto the door,
     so the print looks the same on a phone and a desktop. */
  --u: 96.774px;
  width: 300px;
  transform: scale(var(--k, 1));
  transform-origin: 0 0;
  position: relative;
  padding: calc(0.5 * var(--u)) calc(0.17 * var(--u)) calc(0.3 * var(--u));
  background: linear-gradient(176deg, #fbfaf6 0%, #f4f2ec 46%, #efece5 100%);
  color: #2c2b2a;
  font-family: "SF Mono", Menlo, "Roboto Mono", "DejaVu Sans Mono", Consolas, monospace;
  font-size: calc(0.102 * var(--u));
  line-height: 1.42;
  letter-spacing: 0.01em;
  /* Thermal print sits a hair soft on the paper. */
  text-shadow: 0 0 calc(0.006 * var(--u)) rgba(44, 43, 42, 0.55);
  text-transform: uppercase;
  /* Edge: serrated cut at top and bottom, slightly uneven sides (built in app.js). */
  clip-path: var(--receipt-edge, none);
  overflow: hidden;
}

/* Crumple: soft creases lit from the upper left, like the rest of the door. */
.receipt-paper::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='310' height='720'%3E%3Cfilter id='c' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.011 0.007' numOctaves='4' seed='11'/%3E%3CfeDiffuseLighting lighting-color='%23ffffff' surfaceScale='2.4' diffuseConstant='1.08'%3E%3CfeDistantLight azimuth='225' elevation='56'/%3E%3C/feDiffuseLighting%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23c)'/%3E%3C/svg%3E")
    center / 100% 100% no-repeat;
  mix-blend-mode: multiply;
  opacity: 0.42;
}

/* Two sharper fold lines where it was folded once and flattened again. */
.receipt-paper::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(172deg, transparent 37.6%, rgba(0, 0, 0, 0.07) 38%, rgba(255, 255, 255, 0.6) 38.5%, transparent 39.4%),
    linear-gradient(-6deg, transparent 70.2%, rgba(255, 255, 255, 0.5) 70.6%, rgba(0, 0, 0, 0.06) 71%, transparent 71.8%);
}

.receipt-paper > * {
  position: relative;
  z-index: 1;
}

.receipt-paper p {
  margin: 0;
}

.r-head {
  text-align: center;
  margin-bottom: calc(0.06 * var(--u));
}

.r-store {
  font-size: calc(0.2 * var(--u));
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.15;
  margin-bottom: calc(0.05 * var(--u)) !important;
}

.r-rule {
  height: 0;
  margin: calc(0.07 * var(--u)) 0 !important;
  border-top: calc(0.012 * var(--u)) dashed rgba(44, 43, 42, 0.75);
}

.r-rule-double {
  height: calc(0.03 * var(--u));
  border-bottom: calc(0.012 * var(--u)) dashed rgba(44, 43, 42, 0.75);
}

.r-split {
  display: flex;
  justify-content: space-between;
  gap: 1ch;
}

.r-cols {
  opacity: 0.8;
}

.r-items {
  list-style: none;
  margin: 0;
  padding: 0;
}

.r-items li + li {
  margin-top: calc(0.03 * var(--u));
}

.r-row {
  display: flex;
  align-items: baseline;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-align: left;
  text-decoration: none;
  text-shadow: inherit;
  text-transform: inherit;
}

.r-qty {
  flex: none;
  width: 2.5ch;
}

.r-item,
.r-price {
  flex: none;
  white-space: nowrap;
}

/* The dotted leader from item to price. */
.r-dots {
  flex: 1 1 auto;
  min-width: 1ch;
  overflow: hidden;
  white-space: nowrap;
  margin: 0 0.4ch;
  opacity: 0.7;
}

.r-dots::after {
  content: "................................................................";
}

.r-sub {
  padding-left: 2.5ch;
  font-size: 0.9em;
  opacity: 0.82;
}

.r-total {
  font-size: calc(0.15 * var(--u));
  font-weight: 700;
  margin: calc(0.03 * var(--u)) 0 !important;
}

.r-foot {
  text-align: center;
  margin-top: calc(0.05 * var(--u));
}

.r-barcode {
  display: block;
  width: 78%;
  height: calc(0.34 * var(--u));
  margin: calc(0.08 * var(--u)) auto calc(0.03 * var(--u));
}

.r-barcode rect {
  fill: #2c2b2a;
}

.r-fine {
  font-size: 0.82em;
  letter-spacing: 0.18em;
}

/* Brought up close to read. Lines become links. */
.receipt.is-reading {
  z-index: 60;
  cursor: zoom-out;
  filter:
    drop-shadow(calc(var(--cast-x) * 6) calc(var(--cast-y) * 6) calc(var(--cast-blur) * 8) rgba(30, 24, 16, 0.26))
    drop-shadow(calc(var(--cast-x2) * 4) calc(var(--cast-y2) * 4) calc(var(--cast-blur2) * 3) rgba(30, 24, 16, 0.16));
}

/* Lifted off the door: the magnet stays behind. */
.receipt-magnet {
  transition: opacity 260ms ease;
}

.receipt.is-reading .receipt-magnet {
  opacity: 0;
}

.receipt.is-reading .receipt-act {
  cursor: pointer;
  border-radius: calc(0.02 * var(--u));
}

.receipt.is-reading .receipt-act:hover .r-item,
.receipt.is-reading .receipt-act:hover .r-price,
.receipt.is-reading .receipt-act:focus-visible .r-item,
.receipt.is-reading .receipt-act:focus-visible .r-price {
  text-decoration: underline;
  text-decoration-thickness: calc(0.01 * var(--u));
  text-underline-offset: 0.18em;
}

.receipt.is-reading .receipt-act:focus-visible {
  outline: calc(0.012 * var(--u)) solid rgba(226, 59, 50, 0.7);
  outline-offset: calc(0.01 * var(--u));
}

.receipt-scrim {
  position: absolute;
  inset: 0;
  z-index: 59;
  background: rgba(40, 36, 30, 0.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity 420ms ease;
}

.receipt-scrim.is-on {
  opacity: 1;
  pointer-events: auto;
  cursor: zoom-out;
}

@media (prefers-reduced-motion: reduce) {
  .receipt,
  .receipt-scrim {
    transition: none;
  }
}
