/* ==========================================================================
   GRIT PASS for the corkboard (desk) page: dirt, stains, scars and wear.
   Everything here is ADDED on top of desk.css / office.css / stickers.css, so deleting
   this file (and its <link> in index.html) puts the cleaner look back.
   The textures are made by tools/gen_grit_desk.py (assets/wallgrime, deskgrime, corkgrime, glass, paper).
   Backup of the page before this pass: snapshots/2026-11-25-before-corkboard-grit/
   ========================================================================== */

/* ---- the wall: water stains, mildew, cracks, peeling paper ---- */
.office::before { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: url("../assets/wallgrime.svg") 0 0 / 100% 1200px repeat-y; }
.wallpaper { filter: contrast(1.12) saturate(.8) brightness(.92); }
.wallpaper::before { background: linear-gradient(180deg, #8a6038, #4a2e18 60%, #1e1209);
  box-shadow: 0 6px 18px rgba(0,0,0,.7), inset 0 -3px 0 rgba(0,0,0,.5); }

/* ---- the board: scarred wooden frame, grimy cork, dusty scratched glass ---- */
.board-wrap { filter: none; }
.board-wrap::before { content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none; box-sizing: border-box; padding: 20px;
  background: url("../assets/deskgrime.svg") 0 0 / 900px 450px; mix-blend-mode: multiply;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); }
.board-wrap .board::after { content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: url("../assets/corkgrime.svg") 0 0 / 100% 100%; mix-blend-mode: multiply; opacity: .95; }
.board-wrap::after { content: ""; position: absolute; inset: 0; z-index: 6; pointer-events: none;
  background: url("../assets/glass.svg") 0 0 / 100% 100%; mix-blend-mode: screen; opacity: .8; }
.screw { background: radial-gradient(circle at 35% 30%, #cdb877, #6a5222 60%, #26190a); }
.screw::before { content: ""; position: absolute; left: 50%; top: 100%; width: 5px; height: 26px; margin-left: -2.5px;
  background: linear-gradient(180deg, rgba(120,52,14,.7), transparent); filter: blur(1px); }   /* rust runs down from each screw */

/* ---- papers: foxed, creased, edge-stained, a little rough ---- */
.polaroid::before, .stk::before { content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: url("../assets/paper.svg") 0 0 / 300px 300px; mix-blend-mode: multiply; opacity: .72; }
.polaroid { box-shadow: inset 0 0 22px rgba(120,76,18,.38), inset 0 0 0 1px rgba(0,0,0,.3), 7px 9px 0 rgba(0,0,0,.52); }
.polaroid:nth-child(3n+1) { box-shadow: inset 0 -16px 22px rgba(110,66,14,.45), inset 0 0 0 1px rgba(0,0,0,.3), 7px 9px 0 rgba(0,0,0,.52); }
.stk-wrap { filter: drop-shadow(4px 6px 0 rgba(0,0,0,.5)); }
.stk { box-shadow: inset 0 0 18px rgba(90,50,10,.3); }
.polaroid .cover { filter: contrast(1.12) saturate(.78) sepia(.18); }
.polaroid:nth-child(2n) .cover::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(120deg, transparent 55%, rgba(255,235,190,.16) 56%, transparent 58%), linear-gradient(35deg, transparent 30%, rgba(0,0,0,.22) 31%, transparent 33%); }
.polaroid h3 { text-shadow: .4px .4px 0 rgba(0,0,0,.25); }

/* ---- the desk: scarred wood with rings, burns and ink ---- */
.desk-surface::after { content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: url("../assets/deskgrime.svg") 0 0 / 100% 800px repeat-y; mix-blend-mode: multiply; opacity: .8; }
.archive { box-shadow: inset 0 0 40px rgba(120,76,18,.35), 0 0 0 3px #000, 8px 10px 0 rgba(0,0,0,.5); }
.archive::before { content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: url("../assets/paper.svg") 0 0 / 200px 200px; mix-blend-mode: multiply; opacity: .4; }
.archive > * { position: relative; z-index: 1; }

/* ---- the whole page: heavier grain + comic halftone in the corners ---- */
.desk::after { opacity: .42; }
.desk-vignette { background: radial-gradient(ellipse at 50% 30%, transparent 38%, rgba(0,0,0,.66) 100%); }
.desk-vignette::before { content: ""; position: absolute; inset: 0; opacity: .5;
  background: radial-gradient(circle, rgba(0,0,0,.9) 1.1px, transparent 1.7px) 0 0 / 6px 6px;
  -webkit-mask-image: radial-gradient(ellipse 75% 70% at 50% 45%, transparent 55%, #000 100%); mask-image: radial-gradient(ellipse 75% 70% at 50% 45%, transparent 55%, #000 100%); }

@media (max-width: 760px) { .board-wrap::after, .office::before { opacity: .6; } }
@media (prefers-reduced-motion: reduce) { .desk::after { animation: none; } }

/* ---- the opened case file: a handled, stained dossier ---- */
.dossier { background-image: url("../assets/deskgrime.svg"); background-size: 1400px 700px; background-blend-mode: soft-light; }
.paper { position: relative; box-shadow: inset 0 0 34px rgba(110,66,14,.34); }
.paper::before { content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: url("../assets/paper.svg") 0 0 / 260px 260px; mix-blend-mode: multiply; opacity: .35; }
.paper > *:not(.cf-stamp) { position: relative; z-index: 1; }
.cf-body .photo, .lead-cover { filter: contrast(1.1) saturate(.8) sepia(.15); }

/* ---- scattered board (wide screens): cards and scraps pinned anywhere, js/scatter.js decides where ---- */
.board.scatter .board-grid { display: block; position: relative; margin: 0; }
.board.scatter .polaroid { position: absolute; width: 236px; margin: 0; --dx: 0px; --dy: 0px; }
.board.scatter .stk-wrap { position: absolute; margin: 0; }
.board.scatter .stk-row { display: none; }
