/* Additional explorations: the print desk on the homepage.
   Everything here is scoped to .xd (the section) or .xd-btn / .xd-ghost (used by the desk and the
   note viewer), so nothing else on the page changes. The desk and viewer code load lazily
   (js/desk/loader.js); this file only draws the section and the empty desk so nothing jumps. */
.xd{--xd-ink:#0b1a2b;--xd-ink2:#35516b;--xd-mist:#a9b8c4;--xd-ecru:#f2f1ec;--xd-paper:#fbfaf6;--xd-shadow:#d8d3c4;--xd-warm:#c9c2ae;--xd-accent:#2457dc}


/* header: title, then description, stacked like the other homepage sections (site margins kept) */
.xd-head{display:block;margin:0 0 32px}

/* the desk: a sheet of paper with the dotted pixel grid, framed in ink with a hard shadow */
.xd-desk{position:relative;height:494px;overflow:hidden;color:var(--xd-ink);font:14px/1.5 'Departure Mono',monospace;
  background:radial-gradient(var(--xd-shadow) 1px,transparent 1.5px) 0 0/16px 16px,var(--xd-paper);
  box-shadow:0 0 0 2px var(--xd-ink),6px 6px 0 2px var(--xd-warm);touch-action:pan-y;-webkit-tap-highlight-color:transparent}
.xd-desk *,.xd-desk *::before,.xd-desk *::after{box-sizing:border-box}
.xd-desk.xd-loading::after{content:"loading prints…";position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);font:12px 'Departure Mono',monospace;color:var(--xd-ink2)}

.xd-print{position:absolute;left:0;top:0;padding:8px 8px 32px;margin:0;background:var(--xd-ecru);border:0;border-radius:0;box-shadow:0 0 0 2px var(--xd-ink),4px 4px 0 2px var(--xd-warm);user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;touch-action:pan-y;color:var(--xd-ink);font:inherit}
.xd-print canvas{display:block;image-rendering:pixelated;box-shadow:0 0 0 1px var(--xd-ink)}
.xd-print .xd-lab{position:absolute;left:4px;right:4px;bottom:4px;height:24px;display:flex;gap:8px;align-items:center;padding:0 4px;font:11px/1 'Departure Mono',monospace;color:var(--xd-ink2);white-space:nowrap;overflow:hidden}
.xd-print .xd-lab b{flex:1 1 auto;min-width:0;text-align:left;overflow:hidden;text-overflow:ellipsis;font:700 16px/1 'PP NeueBit',monospace;color:var(--xd-ink)}
/* caption strip: year left, title, logo right, the same pairing as the project cards */
.xd-print .xd-lg{order:2;flex:none;display:block;width:18px;height:18px;image-rendering:pixelated;box-shadow:0 0 0 1px var(--xd-ink)}
.xd-print .xd-yr{order:-1;flex:none;font:700 16px/1 'PP NeueBit',monospace;color:var(--xd-ink)}
/* XOR highlight: the label inverts on hover/focus, the way a selected Finder name did */
.xd-print:hover .xd-lab,.xd-print:focus-visible .xd-lab,.xd-print.sel .xd-lab{background:var(--xd-ink);color:var(--xd-ecru)}
.xd-print:hover .xd-lab b,.xd-print:focus-visible .xd-lab b,.xd-print.sel .xd-lab b,.xd-print:hover .xd-yr,.xd-print:focus-visible .xd-yr,.xd-print.sel .xd-yr{color:var(--xd-ecru)}
.xd-print:hover .xd-lg,.xd-print:focus-visible .xd-lg,.xd-print.sel .xd-lg{box-shadow:0 0 0 1px var(--xd-ecru)}
.xd-print:focus-visible{outline:2px dotted var(--xd-ink);outline-offset:6px}
.xd-print.xd-held{box-shadow:0 0 0 2px var(--xd-ink),4px 4px 0 2px var(--xd-ink)}

.xd-ghost{position:absolute;left:0;top:0;pointer-events:none;z-index:9999;display:none;
  background:linear-gradient(90deg,var(--xd-ink) 50%,transparent 0) 0 0/4px 2px repeat-x,linear-gradient(90deg,var(--xd-ink) 50%,transparent 0) 0 100%/4px 2px repeat-x,
  linear-gradient(0deg,var(--xd-ink) 50%,transparent 0) 0 0/2px 4px repeat-y,linear-gradient(0deg,var(--xd-ink) 50%,transparent 0) 100% 0/2px 4px repeat-y}
html.xd-grabbing,html.xd-grabbing *{cursor:grabbing!important}

/* the bar under the desk: hint on the left, Clean up and Shuffle on the right */
.xd-bar{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-top:20px}
.xd-tools{display:flex;gap:10px;margin-left:auto}
.xd-tip{font:12px/1.4 'Departure Mono',monospace;color:var(--xd-ink2);pointer-events:none}
.xd-tip kbd{font:inherit;border:1px solid var(--xd-ink2);border-radius:3px;padding:0 4px;background:var(--xd-paper)}
.xd-flag{position:absolute;left:0;top:0;z-index:5001;background:#ffe14d;color:#000;font:10px/1 'Departure Mono',monospace;padding:3px 6px;pointer-events:none}

/* notched pixel button, shared with the note viewer */
.xd-btn{position:relative;z-index:0;display:inline-flex;gap:8px;align-items:center;justify-content:center;border:0;border-radius:0;background:none;margin:0;padding:8px 14px;font:700 22px/1 'PP NeueBit',monospace;color:var(--xd-ink,#0b1a2b);user-select:none;-webkit-user-select:none;letter-spacing:0;text-transform:none}
.xd-btn::before,.xd-btn::after{content:"";position:absolute;inset:0;z-index:-1;clip-path:polygon(4px 0,calc(100% - 4px) 0,calc(100% - 4px) 2px,calc(100% - 2px) 2px,calc(100% - 2px) 4px,100% 4px,100% calc(100% - 4px),calc(100% - 2px) calc(100% - 4px),calc(100% - 2px) calc(100% - 2px),calc(100% - 4px) calc(100% - 2px),calc(100% - 4px) 100%,4px 100%,4px calc(100% - 2px),2px calc(100% - 2px),2px calc(100% - 4px),0 calc(100% - 4px),0 4px,2px 4px,2px 2px,4px 2px)}
.xd-btn::before{background:var(--xd-warm,#c9c2ae);transform:translate(2px,2px)}
.xd-btn::after{background:var(--xd-ecru,#f2f1ec);box-shadow:inset 0 0 0 2px var(--xd-ink,#0b1a2b)}
.xd-btn:active,.xd-btn.inv,.xd-btn[aria-pressed=true]{color:var(--xd-ecru,#f2f1ec)}
.xd-btn:active::after,.xd-btn.inv::after,.xd-btn[aria-pressed=true]::after{background:var(--xd-ink,#0b1a2b)}
.xd-btn:focus-visible{outline:2px dotted var(--xd-ink,#0b1a2b);outline-offset:3px}
.xd-btn.sm{height:26px;min-width:26px;padding:0 8px;font-size:18px}

@media (max-width:767px){
  .xd-head{margin-bottom:24px}
  .xd-desk{height:390px}
  .xd-tip{display:none}
  .xd-bar{margin-top:16px}
  .xd-print{padding:5px 5px 24px}.xd-print .xd-lab{height:19px;gap:5px;font-size:10px;left:2px;right:2px;bottom:2px;padding:0 3px}.xd-print .xd-lab b,.xd-print .xd-yr{font-size:14px}.xd-print .xd-lg{width:14px;height:14px}
}
/* Pick up and drop: a hard 1-bit shadow that grows in steps while a print is held, and the dust puff on drop */
.xd-print{transition:box-shadow .12s steps(3,end)}
.xd-print.xd-lift{box-shadow:0 0 0 2px var(--xd-ink),10px 10px 0 2px var(--xd-ink)}
.xd-desk .xd-dust{position:absolute;left:0;top:0;width:4px;height:4px;background:var(--xd-ink);display:none;pointer-events:none}
@media (prefers-reduced-motion:reduce){.xd-print{transition:none}}

/* Dark theme. dark-mode-toggle.js puts .dark-mode on <html> (saved choice, else prefers-color-scheme) and the
   pixel toggle flips it live, so the desk just swaps its tokens. Same roles as light: ink draws frames, text and the
   XOR highlight; ecru is the print card; paper is the desk; warm is the hard offset shadow, now a lifted slate edge
   that reads on the near-black page. The prints re-ink in era.js. */
html.dark-mode .xd{--xd-ink:#d9e0eb;--xd-ink2:#97a3b5;--xd-mist:#3d4653;--xd-ecru:#1a1a1d;--xd-paper:#0f1013;--xd-shadow:#2b3138;--xd-warm:#3d4653;--xd-accent:#8aa8ff;--xd-drop:#000;color-scheme:dark}
/* held and lifted prints throw a real (black) shadow in dark; an ink-coloured one would glow */
html.dark-mode .xd-print.xd-held{box-shadow:0 0 0 2px var(--xd-ink),4px 4px 0 2px var(--xd-drop)}
html.dark-mode .xd-print.xd-lift{box-shadow:0 0 0 2px var(--xd-ink),10px 10px 0 2px var(--xd-drop)}
/* the logo chip keeps its light ground (see flat() in desk.js), so dark marks stay readable; a slate ring sits it in the strip */
html.dark-mode .xd-print .xd-lg{box-shadow:0 0 0 1px var(--xd-warm)}
html.dark-mode .xd-print canvas{box-shadow:0 0 0 1px var(--xd-mist)}
