/* Sockz: a pixel laundromat. Fonts: Jersey 10 (numbers), Pixelify Sans (text), Silkscreen (the machine display). */
@font-face { font-family: "Jersey 10"; src: url("/fonts/jersey10-latin.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Pixelify Sans"; src: url("/fonts/pixelify-latin.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "Silkscreen"; src: url("/fonts/silkscreen-bold-latin.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --navy: #1b1730;
  --ink: #23203a;
  --cream: #fff6e0;
  --paper: #fffaf0;
  --blue: #1f5cff;
  --blue-deep: #143a9e;
  --amber: #ffc83d;
  --mint: #bfe6d3;
  --wood: #6b3f22;
  --text: "Pixelify Sans", "Trebuchet MS", sans-serif;
  --num: "Jersey 10", "Impact", sans-serif;
  --led: "Silkscreen", monospace;
  --pin: url("/img/cursor-pin.png") 2 2, auto;
  --pin-hand: url("/img/cursor-pin-hand.png") 2 2, pointer;
}
* { box-sizing: border-box; }
html { overflow-x: clip; scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100vh; color: var(--navy); background: #7fbfa6;
  font: 400 18px/1.45 var(--text); font-synthesis: none; -webkit-font-smoothing: none;
  cursor: var(--pin);
}
a, button, [role="button"], summary { cursor: var(--pin-hand); }
[hidden] { display: none !important; }
img { max-width: 100%; height: auto; }
canvas { image-rendering: pixelated; image-rendering: crisp-edges; }
.px { image-rendering: pixelated; }

.wall { position: fixed; inset: 0; z-index: 0; background: url("/img/wall.jpg") 30% 100% / cover no-repeat; }
.bubbles { position: fixed; inset: 0; z-index: 0; width: 100%; height: 100%; pointer-events: none; }
.laundry { position: relative; z-index: 1; padding: 0 16px 24px; }

/* ---- the hanging sign ------------------------------------------------------------------------------ */
.sign { position: relative; width: min(1240px, 100%); margin: 0 auto; padding-top: 50px; }
.chain { position: absolute; top: 0; width: 36px; height: auto; image-rendering: pixelated; }
.chain-l { left: 9%; } .chain-r { right: 9%; }
.sign-board {
  display: flex; align-items: center; gap: 32px; min-height: 150px;
  border: 40px solid transparent; border-image: url("/img/board-sign.png") 48 fill / 40px / 0 round stretch;
  padding: 4px 24px 4px 12px; image-rendering: pixelated;
  filter: drop-shadow(0 8px 0 rgba(20, 16, 40, .35));
}
.wordmark { margin: 0; display: flex; align-items: flex-end; gap: 14px; flex: 0 0 auto; }
.wordmark img { width: clamp(180px, 22vw, 300px); height: auto; image-rendering: pixelated; }
.ticker { color: var(--amber); font: 400 34px/1.15 var(--num); letter-spacing: 1px; padding-bottom: 8px; }
.counters { display: flex; flex: 1 1 auto; justify-content: space-around; gap: 16px; margin: 0; }
.counter { display: flex; flex-direction: column; align-items: center; min-width: 140px; }
.counter dt { color: var(--cream); font-size: 18px; line-height: 1.1; order: 2; }
.counter dd { margin: 0; color: var(--amber); font: 400 72px/1.15 var(--num); font-variant-numeric: tabular-nums; order: 1; }

/* ---- the scene ---------------------------------------------------------------------------------------- */
.scene { display: grid; grid-template-columns: minmax(400px, 560px) 1fr; gap: 24px 40px; width: min(1820px, 100%); margin: 20px auto 0; align-items: start; }
.machine-col { position: relative; }
.machine { position: relative; width: 100%; --sh: 0.5px; }
.machine.shaking { animation: shake .32s steps(2, jump-none) infinite; }
@keyframes shake { 0% { transform: translate(0, 0); } 25% { transform: translate(var(--sh), 0); } 50% { transform: translate(0, var(--sh)); } 75% { transform: translate(calc(var(--sh) * -1), 0); } 100% { transform: translate(0, 0); } }
.machine-img { display: block; width: 100%; height: auto; image-rendering: pixelated; filter: drop-shadow(0 10px 0 rgba(20, 16, 40, .28)); }
.porthole { position: absolute; left: 22.77%; top: 30.6%; width: 54.34%; aspect-ratio: 1; border-radius: 50%; overflow: hidden; background: #14121f; }
.porthole canvas { display: block; width: 100%; height: 100%; }
.display { position: absolute; left: 35.56%; top: 9.31%; width: 28.89%; height: 6.98%; display: flex; align-items: center; justify-content: center; gap: .5em; color: var(--amber); font: 700 clamp(14px, 1.25vw, 22px)/1.25 var(--led); text-shadow: 0 0 6px rgba(255, 200, 61, .55); white-space: nowrap; overflow: hidden; }
.panel-keys { position: absolute; left: 67.5%; top: 8.4%; width: 29.4%; height: 8.6%; display: flex; gap: 4%; align-items: center; }
.panel-keys .key { flex: 1 1 0; min-width: 0; padding-left: 10px; padding-right: 10px; justify-content: center; }
.drop { position: absolute; left: 0; top: 0; width: 108px; height: 108px; pointer-events: none; opacity: 0; }

/* the price card standing on the floor beside the machine */
.card {
  position: relative; z-index: 2; flex: 0 0 auto; width: 760px; max-width: 100%; align-self: flex-end;
  border: 36px solid transparent; border-image: url("/img/card.png") 68 90 40 90 fill / 34px 45px 20px 45px / 0 stretch;
  padding: 2px 6px 0; image-rendering: pixelated;
  filter: drop-shadow(0 6px 0 rgba(20, 16, 40, .25));
}
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card-name { font: 700 26px/1.1 var(--text); }
.card-chain { font-size: 16px; color: #4d4a6a; }
.card-label { margin: 10px 0 0; font-size: 16px; color: #4d4a6a; }
.mint { margin: 2px 0 12px; font-size: 18px; line-height: 1.35; min-width: 0; overflow-wrap: anywhere; user-select: all; color: var(--ink); }
.mint.is-empty { user-select: none; color: #6a6786; }
.card-keys { display: flex; flex-wrap: wrap; gap: 10px 12px; }
.card-note { margin: 10px 0 0; font-size: 16px; color: #4d4a6a; min-height: 1.4em; }

/* keys: generated membrane buttons, nine-sliced */
.key {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 56px; padding: 14px 38px;
  border: 0 solid transparent; border-image: url("/img/key.png") 46 fill / 22px / 0 stretch; image-rendering: pixelated;
  font: 700 18px/1.25 var(--text); color: var(--navy); text-decoration: none; background: none; white-space: nowrap;
  transition: transform .08s steps(2), filter .08s;
}
.key:hover { filter: brightness(1.06); }
.key:active { transform: translateY(3px); filter: brightness(.9); }
.key:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.key-blue { border-image-source: url("/img/key-blue.png"); color: #fff; }
.key-sm { min-height: 50px; padding: 12px 28px; font-size: 17px; }
.key[disabled], .key[aria-disabled="true"] { opacity: .55; filter: saturate(.3); pointer-events: none; }
.key .mark { width: 24px; height: 24px; image-rendering: auto; }
.key-blue .mark { filter: brightness(0) invert(1); }
#key-x { padding-left: 34px; padding-right: 34px; }
.key.is-ok { color: #157a3a; }
.key.is-on { color: var(--blue); }
.key.is-bad { color: #b3261e; }

/* ---- the clothesline ------------------------------------------------------------------------------------ */
.line-col { position: relative; min-width: 0; }
.line-wrap { position: relative; height: 340px; }
.line { position: relative; height: 100%; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; overscroll-behavior-x: contain; scroll-snap-type: x proximity; -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 28px, #000 calc(100% - 70px), transparent 100%); mask-image: linear-gradient(90deg, transparent 0, #000 28px, #000 calc(100% - 70px), transparent 100%); }
.line::-webkit-scrollbar { display: none; }
.line:focus-visible { outline: 3px solid var(--blue); outline-offset: -3px; }
.line.dragging { cursor: grabbing; }
.pairs {
  display: flex; align-items: flex-start; gap: 26px; min-width: 100%; height: 100%; padding: 0 40px; margin: 0;
  background: url("/img/rope.png") repeat-x 0 76px / auto 14px; image-rendering: pixelated;
}
.pair { position: relative; flex: 0 0 auto; width: 152px; scroll-snap-align: start; padding-top: 44px; transform-origin: 50% 82px; animation: swing var(--dur, 3.6s) ease-in-out var(--delay, 0s) infinite alternate; }
@keyframes swing { from { transform: rotate(-2.2deg); } to { transform: rotate(2.2deg); } }
.pair.ride-in { animation: ride .8s steps(8) both, swing var(--dur, 3.6s) ease-in-out .8s infinite alternate; }
@keyframes ride { from { transform: translateX(-160px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.pin { display: block; width: 24px; height: auto; margin: 0 auto; position: relative; z-index: 2; image-rendering: pixelated; }
.pair-socks { display: flex; justify-content: center; align-items: flex-start; gap: 6px; margin-top: -14px; min-height: 76px; }
.pair-socks canvas { display: block; }
.pair.rare .pair-socks { filter: drop-shadow(0 0 4px rgba(255, 220, 90, .9)); }
.tag { display: block; width: 140px; height: 111px; margin: 4px auto 0; padding: 40px 12px 0; background: url("/img/tag.png") 0 0 / 100% 100% no-repeat; image-rendering: pixelated; text-align: center; font-size: 16px; line-height: 1.2; color: var(--ink); }
.tag b { display: block; font-weight: 700; }
.line-empty { position: absolute; left: 40px; top: 118px; margin: 0; max-width: 460px; color: #fff; font-size: 20px; font-weight: 700; text-shadow: 0 2px 0 var(--navy), 0 0 6px rgba(20, 16, 40, .5); }

/* the lost pile in the corner */
.floor { display: flex; align-items: flex-end; gap: 32px; margin-top: 8px; }
.corner { position: relative; flex: 1 1 auto; min-width: 0; height: 380px; }
.pile { position: absolute; right: 0; bottom: 0; width: min(100%, 560px); height: 300px; }
.plaque { position: absolute; right: 30px; top: 0; width: 300px; aspect-ratio: 600 / 397; background: url("/img/plaque.png") 0 0 / 100% 100% no-repeat; image-rendering: pixelated; z-index: 2; filter: drop-shadow(0 6px 0 rgba(20, 16, 40, .25)); }
.plaque-face { position: absolute; left: 15%; right: 15%; top: 9%; height: 56%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.plaque-label { font: 700 17px/1.25 var(--text); color: #3d2513; white-space: nowrap; }
.plaque-num { font: 400 54px/1.15 var(--num); color: #2a1a0e; font-variant-numeric: tabular-nums; }

/* ---- how it works: the cork board ------------------------------------------------------------------------- */
.how { width: min(1560px, 100%); margin: 72px auto 40px; }
.board {
  border: 52px solid transparent; border-image: url("/img/board.png") 62 fill / 52px / 0 stretch; image-rendering: pixelated;
  padding: 12px 8px 4px; filter: drop-shadow(0 10px 0 rgba(20, 16, 40, .3));
}
.notes { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; align-items: stretch; }
.note {
  position: relative; display: flex; flex-direction: column;
  border: 44px 20px 22px 20px solid transparent; border-image: url("/img/paper.png") 44 20 22 20 fill / 44px 20px 22px 20px / 0 stretch; image-rendering: pixelated;
  padding: 6px 10px 6px; color: var(--ink);
}
.note .n { font: 400 64px/1.15 var(--num); color: var(--blue); }
.note h2 { margin: 2px 0 8px; font: 400 44px/1.15 var(--num); color: var(--navy); letter-spacing: .5px; }
.note p { margin: 0; font-size: 18px; line-height: 1.45; }
.board-line { margin: 22px 8px 6px; text-align: center; color: var(--cream); font-size: 18px; text-shadow: 0 2px 0 rgba(20, 16, 40, .5); }

/* ---- stats dialog ---------------------------------------------------------------------------------------------- */
.stats { border: 0; padding: 0; background: transparent; width: min(1180px, 94vw); max-width: none; max-height: 92vh; overflow: visible; }
.stats::backdrop { background: rgba(20, 16, 40, .62); }
.board-dialog { position: relative; max-height: 92vh; overflow: auto; }
.stats-title { margin: 0 0 12px; font: 400 44px/1.15 var(--num); color: var(--cream); text-shadow: 0 2px 0 rgba(20, 16, 40, .5); }
.stats-close { position: absolute; right: 8px; top: 4px; }
.papers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; align-items: stretch; }
.paper { border: 44px 20px 22px 20px solid transparent; border-image: url("/img/paper.png") 44 20 22 20 fill / 44px 20px 22px 20px / 0 stretch; image-rendering: pixelated; padding: 4px 8px; min-height: 380px; color: var(--ink); }
.paper h3 { margin: 0; font: 400 34px/1.15 var(--num); color: var(--navy); }
.paper h3.mt { margin-top: 18px; }
.paper-sub { margin: 2px 0 12px; font-size: 16px; color: #4d4a6a; }
.rows { list-style: none; margin: 0; padding: 0; }
.rows li { display: flex; align-items: center; gap: 10px; min-height: 40px; border-bottom: 2px dotted rgba(27, 23, 48, .18); font-size: 17px; }
.rows canvas { flex: 0 0 auto; }
.row-w { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.row-n { font: 400 26px/1.15 var(--num); }
.row-empty { color: #6a6786; font-size: 17px; }
.longest { display: flex; align-items: center; gap: 12px; min-height: 60px; font-size: 17px; }
.facts { list-style: none; margin: 8px 0 0; padding: 0; font-size: 17px; }
.facts li { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; }
.facts b { font: 400 24px/1.15 var(--num); }

/* ---- fly-overs ------------------------------------------------------------------------------------------------ */
.flyer { position: fixed; left: 0; top: 0; z-index: 50; pointer-events: none; }

/* ---- widths ------------------------------------------------------------------------------------------------------ */
@media (max-width: 1500px) {
  .scene { grid-template-columns: minmax(380px, 460px) 1fr; }
  .card { width: 500px; }
  .floor { gap: 20px; }
  .corner { min-width: 280px; }
  .plaque { width: 250px; right: 10px; }
  .plaque-num { font-size: 48px; }
  .counter dd { font-size: 60px; }
  .pile { width: 480px; height: 260px; }
  .corner { height: 340px; }
}
@media (max-width: 1180px) {
  .notes { grid-template-columns: repeat(2, 1fr); }
  .papers { grid-template-columns: 1fr 1fr; }
  .sign-board { gap: 20px; }
  .counter { min-width: 110px; }
  .counter dd { font-size: 52px; }
}
@media (max-width: 900px) {
  body { font-size: 17px; }
  .laundry { padding: 0 12px 20px; }
  .sign { padding-top: 40px; }
  .chain { width: 26px; }
  .sign-board { flex-direction: column; align-items: stretch; gap: 8px; min-height: 0; padding: 6px 4px; border-width: 30px; border-image-width: 30px; }
  .wordmark { justify-content: center; }
  .wordmark img { width: min(220px, 56vw); }
  .ticker { font-size: 28px; padding-bottom: 6px; }
  .counters { justify-content: space-between; gap: 6px; }
  .counter { min-width: 0; flex: 1 1 0; }
  .counter dt { font-size: 16px; text-align: center; }
  .counter dd { font-size: 44px; }
  .scene { grid-template-columns: 1fr; gap: 12px; margin-top: 14px; }
  .machine { width: min(100%, 440px); margin: 0 auto; }
  .panel-keys { position: static; width: auto; height: auto; justify-content: center; gap: 12px; margin: 10px 0 0; }
  .panel-keys .key { flex: 0 1 auto; min-width: 120px; }
  .display { font-size: 16px; }
  .display-word { display: none; }
  .floor { flex-direction: column; align-items: stretch; gap: 14px; }
  .card { width: 100%; align-self: auto; margin: 0; border-width: 30px; border-image-width: 28px 38px 16px 38px; }
  .card-keys .key { flex: 1 1 auto; }
  .card-name { font-size: 24px; }
  .mint { font-size: 17px; }
  .key { padding: 12px 30px; }
  .line-wrap { height: 300px; }
  .pairs { padding: 0 16px; gap: 18px; background-position-y: 62px; }
  .pair { width: 140px; padding-top: 30px; transform-origin: 50% 68px; }
  .line-empty { left: 16px; top: 100px; max-width: 100%; }
  .corner { height: 300px; }
  .pile { width: 100%; height: 220px; right: 0; }
  .plaque { right: 6px; width: 220px; }
  .plaque-num { font-size: 44px; }
  .how { margin-top: 48px; }
  .board { border-width: 34px; border-image-width: 34px; padding: 6px 2px 2px; }
  .notes { grid-template-columns: 1fr; gap: 14px; }
  .note h2 { font-size: 38px; }
  .papers { grid-template-columns: 1fr; }
  .paper { min-height: 0; }
  .stats-title { font-size: 36px; padding-right: 110px; }
}
@media (max-width: 380px) {
  .counter dd { font-size: 38px; }
  .card-keys .key { flex: 1 1 100%; }
  .plaque { width: 190px; }
}

/* ---- motion off ------------------------------------------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .pair, .pair.ride-in, .machine.shaking { animation: none; }
  .key { transition: none; }
}
