/* ---------- the desk (home) ---------- */
.desk {
  --u: min(calc(100vw / 150), calc((100vh - var(--bar)) / 92));
  position: relative; height: calc(100vh - var(--bar)); min-height: 620px; overflow: hidden;
  touch-action: manipulation;
}
.desk > * { position: absolute; }
.mat {
  left: calc(50% - 50 * var(--u)); top: calc(50% - 28 * var(--u)); width: calc(96 * var(--u)); height: calc(60 * var(--u));
  transform: rotate(-2deg); border-radius: calc(1.4 * var(--u));
  background-color: #2350E8;
  background-image:
    linear-gradient(rgba(255, 255, 255, .22) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .22) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, .08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .08) 1px, transparent 1px);
  background-size: calc(10 * var(--u)) calc(10 * var(--u)), calc(10 * var(--u)) calc(10 * var(--u)), calc(2 * var(--u)) calc(2 * var(--u)), calc(2 * var(--u)) calc(2 * var(--u));
  background-position: calc(3 * var(--u)) calc(3 * var(--u));
  box-shadow: 0 2px 0 #1638b8, 10px 18px 40px -16px rgba(16, 30, 90, .55);
}
.mat__ruler { position: absolute; left: calc(3 * var(--u)); right: calc(2 * var(--u)); top: calc(.6 * var(--u)); display: flex; justify-content: space-between; font-family: var(--font-body); font-size: calc(1.15 * var(--u)); color: rgba(255, 255, 255, .7); font-variant-numeric: tabular-nums; pointer-events: none; }
.mat__ruler--side { flex-direction: column; left: calc(.7 * var(--u)); right: auto; top: calc(3 * var(--u)); bottom: calc(2 * var(--u)); }
.mat__angle { position: absolute; right: calc(5 * var(--u)); bottom: calc(5 * var(--u)); width: calc(18 * var(--u)); height: calc(18 * var(--u)); border: 1px solid rgba(255, 255, 255, .35); border-radius: 50%; pointer-events: none; }
.mat__angle::before, .mat__angle::after { content: ""; position: absolute; left: 50%; top: 50%; width: 140%; height: 1px; background: rgba(255, 255, 255, .3); transform: translate(-50%, -50%) rotate(45deg); }
.mat__angle::after { transform: translate(-50%, -50%) rotate(-45deg); }
.desk-hero { left: calc(50% - 33 * var(--u)); top: calc(50% - 8 * var(--u)); width: calc(64 * var(--u)); color: #fff; transform: rotate(-2deg); pointer-events: none; z-index: 2; }
.desk-title { font-family: var(--font-display); font-weight: 400; font-size: calc(10.5 * var(--u)); line-height: .9; margin: 0; letter-spacing: -.01em; pointer-events: auto; white-space: nowrap; }
.desk-sub { font-family: var(--font-hand); font-weight: 700; color: var(--yellow); font-size: calc(3.2 * var(--u)); line-height: 1.05; margin: calc(1.4 * var(--u)) 0 0; transform: rotate(-2deg); }

.thing {
  left: calc(50% + var(--x) * var(--u)); top: calc(50% + var(--y) * var(--u)); width: calc(var(--w) * var(--u));
  transform: translate(-50%, -50%) translate(var(--dx, 0px), var(--dy, 0px)) rotate(var(--r, 0deg));
  transition: transform .35s cubic-bezier(.3, 1.5, .5, 1), filter .3s;
  display: block; color: var(--ink); text-decoration: none; z-index: 3; touch-action: none; user-select: none; -webkit-user-drag: none;
}
.thing img { display: block; width: 100%; height: auto; pointer-events: none; -webkit-user-drag: none; }
.thing:hover, .thing:focus-visible { transform: translate(-50%, -50%) translate(var(--dx, 0px), var(--dy, 0px)) translateY(calc(-1.2 * var(--u))) rotate(calc(var(--r, 0deg) + 2deg)); filter: drop-shadow(0 calc(1.6 * var(--u)) calc(1.4 * var(--u)) rgba(16, 30, 90, .25)); z-index: 6; }
.thing:focus-visible { outline: 3px dashed var(--ink); outline-offset: 8px; }
.thing.is-dragging { transition: none; z-index: 20; filter: drop-shadow(0 calc(2.6 * var(--u)) calc(2 * var(--u)) rgba(16, 30, 90, .32)); cursor: grabbing; }
.thing__label {
  position: absolute; left: 50%; bottom: calc(-3.4 * var(--u)); transform: translateX(-50%) rotate(-3deg);
  background: var(--paper); border: 1.5px solid var(--ink); border-radius: 8px; padding: 2px 10px 3px; white-space: nowrap;
  font-family: var(--font-hand); font-weight: 700; font-size: max(20px, calc(2.4 * var(--u))); line-height: 1.1;
  box-shadow: 2px 2px 0 var(--ink); opacity: 0; transition: opacity .2s, transform .25s; pointer-events: none;
}
.thing:hover .thing__label, .thing:focus-visible .thing__label, .thing.is-dragging .thing__label { opacity: 1; transform: translateX(-50%) rotate(-1deg); }
@media (hover: none) { .thing__label { opacity: 1; } }

/* camera */
.thing--booth { --x: -50; --y: -27; --w: 31; --r: -7deg; }
/* wall board */
.thing--wall { --x: -1; --y: -28; --w: 36; --r: 2deg; }
.deskboard { position: relative; background: var(--paper); padding: calc(1.4 * var(--u)); border-radius: 4px; box-shadow: 6px 8px 0 rgba(16, 30, 90, .14); }
.deskboard canvas { display: block; width: 100%; aspect-ratio: 3 / 2; background: #fafbfd; border: 1px solid var(--line); }
.board__cap { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-top: calc(.8 * var(--u)); font-size: calc(1.5 * var(--u)); }
.board__cap b { font-family: var(--font-display); font-weight: 400; font-size: calc(2 * var(--u)); white-space: nowrap; }
.board__cap span { font-family: var(--font-hand); font-size: calc(2.2 * var(--u)); color: var(--cobalt); font-weight: 700; white-space: nowrap; }
.tape { position: absolute; width: calc(9 * var(--u)); height: calc(2.6 * var(--u)); background: rgba(255, 216, 74, .78); top: calc(-1.3 * var(--u)); left: calc(50% - 4.5 * var(--u)); transform: rotate(-4deg); box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.tape--pink { background: rgba(255, 184, 217, .85); }
/* calendar */
.thing--capsule { --x: 33; --y: -30; --w: 19; --r: 5deg; }
.cal { position: relative; background: var(--paper); border-radius: 6px; overflow: hidden; box-shadow: 0 2px 0 #d0d4de, 0 4px 0 #e2e5ec, 6px 10px 0 rgba(16, 30, 90, .12); text-align: center; }
.cal__top { background: var(--red); color: #fff; padding: calc(1.6 * var(--u)) 0 calc(1 * var(--u)); font-weight: 600; font-size: calc(1.7 * var(--u)); letter-spacing: .04em; position: relative; }
.cal__top::before { content: ""; position: absolute; left: 22%; right: 22%; top: calc(.5 * var(--u)); height: calc(.7 * var(--u)); background: radial-gradient(circle, #000 40%, transparent 42%) 0 0 / calc(2.4 * var(--u)) 100% repeat-x; opacity: .55; }
.cal__day { font-family: var(--font-display); font-size: calc(10 * var(--u)); line-height: 1; padding-top: calc(1.2 * var(--u)); }
.cal__wd { font-family: var(--font-hand); font-size: calc(2.6 * var(--u)); font-weight: 700; padding-bottom: calc(1.4 * var(--u)); color: var(--cobalt); }
.cal::after { content: ""; position: absolute; right: 0; bottom: 0; width: calc(4 * var(--u)); height: calc(4 * var(--u)); background: linear-gradient(135deg, var(--paper) 45%, #d9dde6 50%, #eef0f4 100%); box-shadow: -2px -2px 4px rgba(0, 0, 0, .1); transition: width .3s, height .3s; }
.thing--capsule:hover .cal::after { width: calc(8 * var(--u)); height: calc(8 * var(--u)); }
/* console */
.thing--run { --x: 57; --y: -1; --w: 24; --r: 9deg; }
.console { position: relative; display: block; }
.console-screen { position: absolute; left: 14.72%; top: 17.59%; width: 37.63%; height: 31.74%; clip-path: polygon(.6% .6%, 98.9% 7.2%, 98.4% 99.4%, 1.6% 89.8%); image-rendering: pixelated; pointer-events: none; }
/* VHS stack */
.thing--films { --x: -64; --y: 1; --w: 20; --r: -7deg; }
.dvhs-stack { display: grid; gap: calc(.5 * var(--u)); }
.dvhs { position: relative; display: grid; place-items: center; height: calc(5 * var(--u)); border-radius: calc(.5 * var(--u)); background: #15161d; box-shadow: 0 calc(.5 * var(--u)) 0 rgba(0, 0, 0, .25); }
.dvhs b { background: var(--paper); color: var(--ink); width: 64%; height: 64%; display: grid; place-items: center; font-family: var(--font-display); font-weight: 400; font-size: calc(1.7 * var(--u)); letter-spacing: .04em; border-radius: 2px; }
.dvhs--1 { transform: translateX(calc(1.6 * var(--u))) rotate(3deg); background: var(--cobalt); }
.dvhs--1 b { background: var(--yellow); }
.dvhs--2 { transform: translateX(calc(-1 * var(--u))) rotate(-2deg); }
.dvhs--2 b { background: var(--pink); }
.dvhs--3 { transform: rotate(1deg); }
.thing--films:hover .dvhs--1 { transform: translateX(calc(4 * var(--u))) rotate(8deg); }
.dvhs::before, .dvhs::after { content: ""; position: absolute; top: 50%; width: calc(1.1 * var(--u)); height: calc(1.1 * var(--u)); border-radius: 50%; background: #555a66; transform: translateY(-50%); }
.dvhs::before { left: 7%; } .dvhs::after { right: 7%; }
/* toys */
.thing--objects { --x: 36; --y: 30; --w: 42; --r: -2deg; }
/* CD stack: opens the player */
.thing--cd { --x: -55; --y: 29; --w: 26; --r: -7deg; border: 0; padding: 0; background: none; font: inherit; color: inherit; cursor: pointer; }
.dcd { position: relative; display: block; width: calc(28 * var(--u)); height: calc(21 * var(--u)); }
.dcd__case { position: absolute; width: calc(17 * var(--u)); aspect-ratio: 1; display: grid; place-items: center; border: 2px solid var(--ink); border-radius: calc(.6 * var(--u)); background: var(--bg); box-shadow: 0 3px 0 rgba(0, 0, 0, .2); overflow: hidden; transition: transform .3s cubic-bezier(.3, 1.4, .5, 1); }
.dcd__case::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 11%; background: rgba(0, 0, 0, .28); border-right: 1px solid rgba(255, 255, 255, .35); }
.dcd__case::after { content: ""; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(255, 255, 255, .55), transparent 38%, transparent 70%, rgba(255, 255, 255, .25)); }
.dcd__case b { position: relative; z-index: 1; font-family: var(--font-hand); font-weight: 700; font-size: calc(3.6 * var(--u)); line-height: 1; transform: rotate(-8deg); }
.dcd__case--1 { left: 0; top: calc(4 * var(--u)); transform: rotate(-9deg); color: #fff; }
.dcd__case--2 { left: calc(3.5 * var(--u)); top: calc(2 * var(--u)); transform: rotate(6deg); color: var(--pink); }
.dcd__case--3 { left: calc(7 * var(--u)); top: 0; transform: rotate(-2deg); color: var(--ink); }
.dcd__disc { position: absolute; left: calc(12 * var(--u)); top: calc(2.5 * var(--u)); width: calc(15 * var(--u)); aspect-ratio: 1; border-radius: 50%; border: 2px solid var(--ink);
  background: radial-gradient(circle, var(--paper) 0 9%, var(--ink) 9.5% 12%, transparent 12.5%), conic-gradient(from 30deg, #e9edf5, #c9d6ff, #ffd9ec, #fff2b8, #d4f5ff, #e9edf5, #c9d6ff, #ffd9ec, #e9edf5);
  transition: transform .45s cubic-bezier(.3, 1.4, .5, 1); }
.thing--cd:hover .dcd__disc, .thing--cd:focus-visible .dcd__disc { transform: translateX(calc(4 * var(--u))) rotate(120deg); }
.thing--cd:hover .dcd__case--1 { transform: rotate(-14deg) translateX(calc(-1 * var(--u))); }

/* decor */
.note-phrase { left: calc(50% + 6 * var(--u)); top: calc(50% + 31 * var(--u)); width: calc(20 * var(--u)); min-height: calc(17 * var(--u)); transform: translate(-50%, -50%) rotate(-4deg); background: #FFE45C; padding: calc(2.4 * var(--u)) calc(1.8 * var(--u)) calc(1.6 * var(--u)); border: 0; text-align: left; font-family: var(--font-hand); font-weight: 700; font-size: calc(2.7 * var(--u)); line-height: 1.05; box-shadow: 2px 6px 10px -4px rgba(0, 0, 0, .25); z-index: 4; transition: transform .25s; }
.note-phrase:hover { transform: translate(-50%, -50%) rotate(-1deg) scale(1.03); }
.note-phrase span { overflow-wrap: anywhere; }
.note-phrase small { display: block; margin-top: calc(1.2 * var(--u)); font-family: var(--font-body); font-weight: 500; font-size: max(11px, calc(1.2 * var(--u))); color: rgba(0, 0, 0, .55); }
.decor { pointer-events: none; z-index: 2; }
.pencil { left: calc(50% - 22 * var(--u)); top: calc(50% + 33 * var(--u)); width: calc(30 * var(--u)); height: calc(2.4 * var(--u)); transform: rotate(-14deg); background: linear-gradient(90deg, #f6d2a8 0 8%, var(--yellow) 8% 88%, #bfc4ce 88% 92%, var(--pink) 92%); clip-path: polygon(0 50%, 8% 0, 100% 0, 100% 100%, 8% 100%); box-shadow: 0 6px 6px -4px rgba(0, 0, 0, .3); }
.pencil::before { content: ""; position: absolute; left: 0; top: 35%; width: 3%; height: 30%; background: #222; }
.ring { left: calc(50% + 61 * var(--u)); top: calc(50% - 39 * var(--u)); width: calc(14 * var(--u)); height: calc(13 * var(--u)); border-radius: 48% 52% 50% 50%; border: calc(.55 * var(--u)) solid rgba(130, 84, 44, .2); background: radial-gradient(circle at 55% 45%, rgba(130, 84, 44, .07), rgba(130, 84, 44, .02) 65%, transparent 70%); box-shadow: inset 0 0 calc(.6 * var(--u)) rgba(130, 84, 44, .18); }
.eraser { left: calc(50% + 18 * var(--u)); top: calc(50% + 10 * var(--u)); width: calc(9 * var(--u)); height: calc(4.5 * var(--u)); background: linear-gradient(90deg, var(--pink) 0 55%, var(--sky) 55%); border-radius: calc(.8 * var(--u)); transform: rotate(18deg); box-shadow: 0 4px 0 rgba(0, 0, 0, .15); }
.clip { left: calc(50% - 25 * var(--u)); top: calc(50% - 44 * var(--u)); width: calc(3.4 * var(--u)); height: calc(9 * var(--u)); border: calc(.5 * var(--u)) solid #9aa1ae; border-radius: 99px; transform: rotate(-30deg); }
.clip::after { content: ""; position: absolute; left: 18%; right: 18%; top: 22%; bottom: 8%; border: calc(.45 * var(--u)) solid #9aa1ae; border-top: 0; border-radius: 0 0 99px 99px; }
.hint-move { left: calc(50% - 68 * var(--u)); bottom: calc(2 * var(--u)); font-family: var(--font-hand); font-size: max(18px, calc(2.2 * var(--u))); color: var(--muted); transform: rotate(-2deg); margin: 0; z-index: 2; }
.desk-reset { right: calc(1.6 * var(--u)); bottom: calc(1.6 * var(--u)); z-index: 7; }

/* phones: the desk becomes a tidy drawer of things, two per row, labels underneath */
@media (max-width: 819px) {
  .desk { height: auto; min-height: 0; overflow: visible; overflow-x: clip; display: grid; grid-template-columns: 1fr 1fr; gap: 30px 12px; padding: 14px 14px 40px; --u: 1px; align-items: end; }
  .desk > * { position: relative; }
  .mat, .desk-hero { grid-row: 1; grid-column: 1 / -1; align-self: stretch; }
  .mat { left: auto; top: auto; width: auto; height: auto; transform: rotate(-1deg); border-radius: 16px; --u: 3.4px; margin-bottom: 4px; }
  .desk-hero { left: auto; top: auto; width: auto; transform: rotate(-1deg); padding: 40px 20px 24px; }
  .desk-title { font-size: clamp(40px, 14vw, 64px); }
  .desk-sub { font-size: 21px; margin-top: 10px; line-height: 1.1; transform: rotate(-1.5deg); text-wrap: balance; }
  .mat__angle, .mat__ruler--side { display: none; }
  .mat__ruler { font-size: 9px; left: 14px; right: 12px; top: 8px; }

  .thing { left: auto; top: auto; width: auto; --dx: 0px; --dy: 0px; --u: 4.2px; touch-action: auto; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 10px; transform: rotate(var(--r)); min-width: 0; }
  .thing:hover, .thing:focus-visible { transform: rotate(0deg) translateY(-3px); filter: none; }
  .thing > img, .thing .console img { width: auto; max-width: 100%; height: 132px; object-fit: contain; }
  .thing__label { position: static; transform: rotate(-2deg); opacity: 1; font-size: 18px; padding: 1px 10px 2px; box-shadow: 2px 2px 0 var(--ink); white-space: normal; text-align: center; text-wrap: balance; max-width: 100%; }
  .thing:hover .thing__label, .thing:focus-visible .thing__label { transform: rotate(-1deg); }

  .thing--booth { order: 1; --r: -2deg; }
  .thing--capsule { order: 2; --r: 2deg; }
  .thing--capsule .cal { width: 128px; --u: 4.1px; }
  .thing--wall { order: 3; grid-column: 1 / -1; --r: .6deg; --u: 3.4px; }
  .thing--wall .deskboard { width: 100%; padding: 8px 8px 10px; }
  .deskboard canvas { aspect-ratio: 16 / 9; }
  .deskboard__cap, .board__cap { flex-wrap: nowrap; }
  .board__cap b { font-size: 17px; white-space: nowrap; }
  .board__cap span { font-size: 21px; }
  .tape { width: 64px; height: 18px; top: -9px; left: calc(50% - 32px); }
  .thing--wall .thing__label { display: none; }
  .thing--run { order: 4; --r: 3deg; }
  .thing--run .console { height: 132px; }
  .thing--run .console img { height: 100%; }
  .thing--cd { order: 5; --r: -3deg; --u: 5px; }
  .thing--cd .dcd { margin-top: 14px; }
  .thing--objects { order: 6; grid-column: 1 / -1; --r: -1deg; }
  .thing--objects > img { height: auto; width: 92%; }
  .thing--films { order: 7; --r: -3deg; --u: 6.4px; }
  .thing--films .dvhs-stack { width: 150px; margin-top: 10px; }
  .note-phrase { order: 8; justify-self: center; left: auto; top: auto; width: 100%; min-height: 0; transform: rotate(-2deg); font-size: 20px; padding: 20px 14px 12px; }
  .note-phrase small { font-size: 12px; margin-top: 10px; }
  .note-phrase:hover { transform: rotate(-1deg); }
  .decor, .hint-move, .desk-reset { display: none; }
}
