:root {
  --h: 100svh;               /* drive height, set by app.js */
  --u: calc(var(--h) / 1536); /* one strip pixel */
  --concrete: #b8ad9c;
  --kraft: #c9a77a;
  --kraft-d: #a8834f;
  --tape: #efe3c4;
  --ink: #1d1a17;
  --ink-2: #4b4339;
  --marker: "Permanent Marker", "Marker Felt", "Comic Sans MS", cursive;
  --type: "Courier Prime", "Courier New", ui-monospace, monospace;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--concrete); color: var(--ink); overflow: hidden; }
body { font: 16px/1.5 var(--type); -webkit-tap-highlight-color: transparent; }

/* ---------- the driveway */
#scroller {
  position: fixed; inset: 0; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain;
  scrollbar-width: none; cursor: grab; touch-action: pan-x;
}
#scroller::-webkit-scrollbar { display: none; }
#scroller.dragging { cursor: grabbing; scroll-behavior: auto; }
#drive {
  position: relative; height: var(--h); width: calc(var(--u) * 10944);
  transform-origin: 0 0; transition: transform .55s cubic-bezier(.3, .7, .2, 1), filter .55s;
}
#drive.near { filter: brightness(.82) saturate(.92); }
#tiles { position: absolute; inset: 0; display: flex; }
#tiles img { display: block; height: 100%; width: calc(100% / 6); user-select: none; -webkit-user-drag: none; pointer-events: none; }
#tiles { background: url(art/drive-preview.webp) 0 0 / 100% 100% no-repeat; }
#apron {
  position: relative; width: calc(var(--u) * 10944); height: calc(100svh - var(--h) + 48px); margin-top: -48px; display: none;
  background: url(art/apron.webp) 0 0 / auto 100% repeat-x;
  -webkit-mask-image: linear-gradient(#0000, #000 48px); mask-image: linear-gradient(#0000, #000 48px);
}
#apron.on { display: block; }

/* ---------- the things for sale */
.spot { position: absolute; inset: auto; padding: 0; margin: 0; border: 0; background: none; cursor: pointer; }
.hit { position: absolute; display: block; border-radius: calc(var(--u) * 40); }
.spot:focus { outline: none; }
.spot:focus-visible .hit { outline: 3px dashed #fff8; outline-offset: 2px; }
.tagline {
  position: absolute; transform: translate(-50%, 0) rotate(var(--r, -2deg)); transform-origin: 50% 0;
  width: max-content; max-width: 9em; padding: 9px 4px; margin-top: -9px;
  font: calc(max(13px, var(--u) * 27)) / 1.08 var(--marker); color: var(--ink); letter-spacing: .01em; text-align: center;
  pointer-events: auto; transition: transform .18s ease-out, opacity .3s;
}
.tagline .paper {
  display: block; padding: .28em .7em .3em; background: var(--tape);
  background-image: linear-gradient(180deg, #fff6 0, transparent 40%), repeating-linear-gradient(90deg, #0000 0 3px, #00000006 3px 4px);
  clip-path: polygon(0 4%, 3% 0, 8% 6%, 14% 1%, 22% 5%, 30% 0, 41% 4%, 52% 1%, 63% 5%, 74% 0, 85% 4%, 93% 1%, 100% 5%, 98% 50%, 100% 95%, 92% 100%, 81% 96%, 70% 100%, 58% 95%, 47% 100%, 35% 96%, 24% 100%, 13% 95%, 4% 100%, 1% 96%, 2% 50%);
  filter: drop-shadow(0 2px 2px #0005);
}
.tagline.far { opacity: .4; }
.spot:hover .tagline, .spot:focus-visible .tagline { transform: translate(-50%, -6%) rotate(0deg) scale(1.12); opacity: 1; }
.spot .glow {
  position: absolute; pointer-events: none; opacity: 0; transition: opacity .2s;
  background: radial-gradient(closest-side, #fff4, #fff0); mix-blend-mode: soft-light;
}
.spot:hover .glow, .spot:focus-visible .glow { opacity: 1; }

/* ---------- sound toggle: a strip of tape in the corner */
#sound {
  position: fixed; left: max(10px, env(safe-area-inset-left)); bottom: max(10px, env(safe-area-inset-bottom)); z-index: 5;
  width: 44px; height: 44px; border: 0; border-radius: 4px; background: #efe3c4e6; box-shadow: 0 2px 4px #0004; cursor: pointer;
}
#sound span { display: block; width: 20px; height: 20px; margin: auto; background: var(--ink);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M3 7h3l5-4v14l-5-4H3z'/%3E%3Cpath d='M13.5 6.5q2 3.5 0 7M15.5 4.5q3.5 5.5 0 11' stroke='%23000' stroke-width='1.6' fill='none'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M3 7h3l5-4v14l-5-4H3z'/%3E%3Cpath d='M13.5 6.5q2 3.5 0 7M15.5 4.5q3.5 5.5 0 11' stroke='%23000' stroke-width='1.6' fill='none'/%3E%3C/svg%3E") center / contain no-repeat; }
#sound[aria-pressed="false"] span { opacity: .35; }
#sound:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* ---------- sheets (dialogs) */
dialog.sheet { padding: 0; border: 0; background: transparent; max-width: none; max-height: none; overflow: visible; color: var(--ink); }
dialog.sheet::backdrop { background: #1a14104d; }
dialog.sheet[open] { animation: flip .42s cubic-bezier(.2, .8, .25, 1.05); }
@keyframes flip { from { transform: perspective(1200px) rotateY(-80deg) translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { dialog.sheet[open] { animation: none; } #drive { transition: none; } }
.close {
  position: absolute; top: 10px; right: 10px; z-index: 2; width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: #00000014; color: var(--ink); font: 30px/44px system-ui, sans-serif; cursor: pointer;
}
.close:hover { background: #00000026; }
.close:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* the price tag, flipped over: a big kraft shipping tag */
.tagsheet { width: min(980px, calc(100vw - 40px)); }
.tagcard {
  position: relative; height: min(88svh, 1100px); overflow: auto; overscroll-behavior: contain;
  padding: 26px 34px 40px 96px;
  background: var(--kraft);
  background-image: radial-gradient(#0000 60%, #7a55250f), repeating-linear-gradient(8deg, #0000 0 2px, #6a4a1a08 2px 3px);
  clip-path: polygon(64px 0, 100% 0, 100% 100%, 64px 100%, 0 calc(100% - 64px), 0 64px);
  --ab-fg: var(--ink); --ab-muted: var(--ink-2); --ab-accent: var(--ink); --ab-chrome: 140px;
}
.eyelet {
  position: absolute; left: 22px; top: 50%; width: 34px; height: 34px; margin-top: -17px; border-radius: 50%;
  background: radial-gradient(circle, #2a2118 0 7px, #e9dcc0 8px 15px, #a8834f 16px);
  box-shadow: inset 0 1px 2px #0006;
}
.tag-head { margin: 4px 50px 18px 0; }
.tag-client { margin: 0 0 2px; font: 700 13px/1.2 var(--type); letter-spacing: .16em; color: var(--ink-2); }
.tag-title { margin: 0; font: clamp(30px, 4.6vw, 54px)/1 var(--marker); }
.tag-body { font-size: 16px; }
.tag-body .ab-lede { font-size: 18px; max-width: 46em; }
.tag-body .ab-heading { font: 22px/1.1 var(--marker); }
.tag-body .ab-credits { padding-top: 10px; border-top: 2px dashed #6a4a1a55; }
.tag-body .ab-frame, .tag-body .ab-image img { box-shadow: 0 3px 10px #0004; }

/* the free box: every tag in a pile */
.boxsheet { width: min(1060px, calc(100vw - 32px)); }
.boxcard {
  position: relative; max-height: 88svh; overflow: auto; overscroll-behavior: contain; padding: 22px 26px 34px;
  background: #b98d5a; background-image: linear-gradient(90deg, #0000 49.6%, #0000001a 50%, #0000 50.4%), repeating-linear-gradient(0deg, #0000 0 6px, #00000008 6px 7px);
  border-radius: 3px; box-shadow: 0 10px 40px #0007;
}
.box-word { margin: 0 0 14px; font: 64px/1 var(--marker); color: #1b1712; transform: rotate(-2deg); }
.pile { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px 12px; }
.pile li { display: flex; }
.pile button {
  position: relative; width: 100%; min-height: 84px; padding: 12px 10px 10px 30px; border: 0; cursor: pointer; text-align: left;
  font: 18px/1.05 var(--marker); color: var(--ink); background: #f3e6c6;
  clip-path: polygon(18px 0, 100% 0, 100% 100%, 18px 100%, 0 calc(100% - 18px), 0 18px);
  transform: rotate(var(--r, 0deg)); transition: transform .15s;
}
.pile button::before { content: ""; position: absolute; left: 8px; top: 50%; width: 12px; height: 12px; margin-top: -6px; border-radius: 50%; background: #2a2118; box-shadow: 0 0 0 3px #e2d2ad; }
.pile button small { display: block; margin-top: 6px; font: 700 10px/1.2 var(--type); letter-spacing: .14em; color: var(--ink-2); }
.pile button:hover, .pile button:focus-visible { transform: rotate(0) scale(1.05); }
.pile button:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

/* the cash box: who's selling */
.aboutsheet { width: min(620px, calc(100vw - 32px)); }
.aboutcard {
  position: relative; max-height: 88svh; overflow: auto; padding: 30px 32px 28px;
  background: #fbf8ef; background-image: linear-gradient(#0000 96px, #e05a5a66 96px 98px, #0000 98px), repeating-linear-gradient(#0000 0 27px, #8fb3d466 27px 28px);
  background-position: 0 0, 0 22px; box-shadow: 0 10px 40px #0007; border-radius: 2px;
}
.aboutcard h2 { margin: 0 50px 4px 0; font: 36px/1.1 var(--marker); }
.about-title { margin: 0 0 12px; font-weight: 700; }
.about-bio { margin: 0 0 14px; }
.about-jobs { margin: 0 0 14px; padding: 0; list-style: none; }
.about-jobs li { line-height: 28px; }
.about-jobs b { font-weight: 700; }
.about-contact { margin: 0; }
.about-contact a { color: inherit; }

/* ---------- the loader: the sign, being taped up */
#loader { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; background: var(--concrete); transition: opacity .5s; }
#loader.done { opacity: 0; pointer-events: none; }
.sign {
  position: relative; padding: 34px 44px 30px; background: #c3a170; transform: rotate(-3deg);
  background-image: repeating-linear-gradient(0deg, #0000 0 5px, #0000000a 5px 6px); box-shadow: 0 8px 18px #0004;
}
.sign-word { display: block; font: clamp(30px, 7vw, 56px)/1.02 var(--marker); color: #191510; text-align: center; }
.tape { position: absolute; left: 50%; top: -14px; width: 70%; height: 26px; transform: translateX(-50%) rotate(2deg); background: #efe3c455; overflow: hidden; }
.tape i { display: block; height: 100%; width: 0; background: var(--tape); transition: width .25s; }

/* ---------- phones */
@media (max-width: 640px) {
  .tagsheet, .boxsheet, .aboutsheet { width: 100vw; }
  dialog.sheet { margin: 0; }
  .tagcard { height: 100svh; padding: 64px 16px 40px; clip-path: none; --ab-chrome: 110px; }
  .eyelet { left: 50%; top: 18px; margin: 0 0 0 -15px; width: 30px; height: 30px; }
  .tag-head { margin-right: 0; }
  .boxcard, .aboutcard { max-height: 100svh; height: 100svh; border-radius: 0; padding-top: 18px; }
  .pile { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .box-word { font-size: 48px; }
}
