/* Red String: a corkboard in a dim office under one desk lamp. */
:root {
  --ink: #1b1a1c;
  --paper: #f5f1e7;
  --card: #fbf9f1;
  --yarn: #a9141c;
  --yarn-lit: #e2232c;
  --manila: #dcbb80;
  --manila-dk: #c3a062;
  --type: #27231f;
  --marker: 'Permanent Marker', 'Marker Felt', 'Comic Sans MS', cursive;
  --typewriter: 'Special Elite', 'Courier New', monospace;
  --courier: 'Courier Prime', 'Courier New', monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0d0b09; color: #eee; overscroll-behavior: none; }
body { font-family: var(--courier); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; }

/* ---------------- the room and the wall */
#room { position: fixed; inset: 0; overflow: hidden;
  background: radial-gradient(ellipse 90% 80% at 45% 40%, #2a241d 0%, #17130f 55%, #0b0907 100%); }
#view { position: absolute; inset: 0; overflow: hidden; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
#view.grabbing { cursor: grabbing; }
#world { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
#world.moving { will-change: transform; }
#frame { position: absolute; left: 0; top: 0; border-radius: 6px;
  background:
    repeating-linear-gradient(90deg, rgba(0,0,0,.07) 0 3px, rgba(255,255,255,.035) 3px 5px, rgba(0,0,0,0) 5px 11px),
    linear-gradient(180deg, #7a522e, #5d3c1f 50%, #6e4828);
  box-shadow: 0 30px 80px rgba(0,0,0,.6), 0 0 0 2px #2c1b0c, inset 0 2px 0 rgba(255,220,170,.18); }
#cork { position: absolute; background-color: #a4744a; background-size: 512px 512px;
  box-shadow: inset 0 0 0 2px rgba(40,22,8,.55), inset 0 6px 14px rgba(0,0,0,.45), inset 0 -2px 8px rgba(0,0,0,.25); }
#corkfx { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#items, #pins { position: absolute; left: 0; top: 0; }
#yarn { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
#pins, #light { pointer-events: none; }
#light { position: absolute; left: 0; top: 0; }

/* prints: whole, white border, the title in marker on the bottom border */
.photo { position: absolute; display: block; padding: 11px 11px 0; margin: 0; border: 0; border-radius: 1px;
  background: var(--paper); cursor: pointer; transform-origin: 50% 50%;
  transition: filter .3s ease; }
.photo img { display: block; width: 100%; height: auto; background: #222; pointer-events: none; -webkit-user-drag: none; }
.photo::before { content: ''; position: absolute; left: 11px; right: 11px; top: 11px; bottom: 44px; pointer-events: none;
  background: linear-gradient(118deg, rgba(255,255,255,.16) 0%, rgba(255,255,255,0) 32%, rgba(255,255,255,0) 70%, rgba(255,255,255,.06) 100%); }
.photo .cap { display: block; height: 44px; line-height: 46px; text-align: center; white-space: nowrap; overflow: visible;
  font: 29px/46px var(--marker); color: var(--ink); letter-spacing: .01em; }
.photo:hover, .photo:focus-visible { filter: brightness(1.1); }
.photo:focus-visible, .card:focus-visible { outline: 5px solid #ffd27a; outline-offset: 6px; }
.photo.hit, .card.hit { filter: brightness(1.35) !important; }

/* index cards in marker */
.card { position: absolute; display: grid; place-items: center; margin: 0; border: 0; padding: 34px 14px 10px; cursor: pointer;
  background:
    linear-gradient(#e3797a, #e3797a) 0 30px / 100% 2px no-repeat,
    repeating-linear-gradient(180deg, rgba(0,0,0,0) 0 22px, #b3cde3 22px 23.5px) 0 33px / 100% calc(100% - 33px) no-repeat,
    linear-gradient(170deg, #fdfbf4, #f2eee2);
  border-radius: 2px; transition: filter .3s ease; color: var(--ink); }
.card .ink { display: block; font: 32px/1.05 var(--marker); text-align: center; white-space: nowrap; letter-spacing: .01em; }
.card .ink + .ink { margin-top: 2px; }
.card:hover, .card:focus-visible { filter: brightness(1.06); }
.card.mike .ink { font-size: 44px; }
.card .under { position: absolute; left: 14%; right: 14%; bottom: 22px; height: 16px; pointer-events: none; }
.card .ring { position: absolute; pointer-events: none; border-radius: 50%; box-shadow: inset 0 0 0 5px rgba(120,72,30,.16), inset 0 0 0 7px rgba(120,72,30,.05); }

/* pushpins */
.pin { position: absolute; width: 0; height: 0; }
.pin::after { content: ''; position: absolute; width: 17px; height: 17px; left: -8.5px; top: -8.5px; border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, rgba(255,255,255,.85) 0 8%, var(--pc, #c8161e) 30%, var(--pd, #5e0508) 100%);
  box-shadow: inset -1px -2px 3px rgba(0,0,0,.35); }
.pin::before { content: ''; position: absolute; width: 16px; height: 10px; left: calc(-8px + var(--sx, 4px)); top: calc(-4px + var(--sy, 5px));
  border-radius: 50%; background: rgba(0,0,0,.42); filter: blur(2.5px); }

/* yarn */
#yarn .sh { fill: none; stroke: rgba(10,4,0,.38); stroke-width: 3.6; stroke-linecap: round; }
#yarn .y { fill: none; stroke: var(--yarn); stroke-width: 3.2; stroke-linecap: round; }
#yarn .f { fill: none; stroke: rgba(240,110,110,.55); stroke-width: 1.1; stroke-dasharray: 2.5 4.5; stroke-linecap: round; }
#yarn .s { transition: opacity .35s ease; }
#yarn .s.near .y { stroke: #c81a23; stroke-width: 3.8; }
#world.lit #yarn .s { opacity: .1; }
#world.lit #yarn .s.on { opacity: 1; }
#world.lit #yarn .s.on .y { stroke: var(--yarn-lit); stroke-width: 4.2; }
#world.lit #yarn .s.on .f { stroke: rgba(255,170,160,.75); }
#yarn .trace { fill: none; stroke: #ff8a7a; stroke-width: 6; stroke-linecap: round; opacity: .85; filter: drop-shadow(0 0 6px rgba(255,90,70,.8)); }
#world.lit .photo:not(.on), #world.lit .card:not(.on) { filter: brightness(.42) saturate(.55); }

/* the lamp */
.vignette { position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 75% 70% at 50% 46%, rgba(0,0,0,0) 52%, rgba(0,0,0,.38) 82%, rgba(0,0,0,.7) 100%); }

/* ---------------- the filing cabinet */
.cabinet { position: fixed; right: -10px; bottom: -14px; z-index: 20; width: 248px; height: 158px; padding: 0; border: 0; background: none; cursor: pointer;
  transform-origin: 100% 100%; transition: translate .35s cubic-bezier(.3,.7,.3,1); }
.cabinet .tabs { position: absolute; left: 26px; right: 30px; top: -2px; height: 30px; display: block; }
.cabinet .tabs i { position: absolute; bottom: 0; width: 64px; height: 22px; border-radius: 5px 5px 0 0;
  background: linear-gradient(#e6c88f, #c9a565); box-shadow: 0 -1px 0 rgba(255,255,255,.25) inset, 0 2px 4px rgba(0,0,0,.4); }
.cabinet .tabs i:nth-child(1) { left: 0; height: 20px; }
.cabinet .tabs i:nth-child(2) { left: 62px; height: 25px; background: linear-gradient(#ead09b, #cfab6c); }
.cabinet .tabs i:nth-child(3) { left: 124px; height: 18px; }
.cabinet .tabs i:nth-child(4) { left: 40px; height: 14px; background: linear-gradient(#dcc08a, #c19c5c); }
.cabinet .front { position: absolute; left: 0; right: 0; top: 22px; bottom: 0; display: block; border-radius: 6px 4px 0 0;
  background: linear-gradient(180deg, #727a71 0%, #5a6159 8%, #4a5049 70%, #3a3f39 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.28), inset 0 -10px 20px rgba(0,0,0,.35), 0 -6px 30px rgba(0,0,0,.65), -14px 0 40px rgba(0,0,0,.5); }
.cabinet .front::before { content: ''; position: absolute; inset: 8px 10px auto 10px; height: 1px; background: rgba(255,255,255,.12); }
.cabinet .holder { position: absolute; left: 50%; top: 22px; width: 84px; height: 30px; margin-left: -42px; border-radius: 3px;
  background: linear-gradient(#c9b27a, #8c7440); box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 2px 3px rgba(0,0,0,.5); }
.cabinet .slip { position: absolute; inset: 5px 6px; background: #f2eedf; box-shadow: inset 0 1px 2px rgba(0,0,0,.25); }
.cabinet .pull { position: absolute; left: 50%; top: 66px; width: 128px; height: 30px; margin-left: -64px; border-radius: 4px 4px 14px 14px;
  background: linear-gradient(180deg, #d6dad5 0%, #9aa099 30%, #6f756e 70%, #4b504a 100%);
  box-shadow: 0 4px 6px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.6); }
.cabinet .pull::after { content: ''; position: absolute; left: 10px; right: 10px; bottom: 5px; height: 9px; border-radius: 0 0 9px 9px; background: rgba(0,0,0,.45); }
.cabinet:hover { translate: -6px 0; }
.cabinet:focus-visible { outline: 3px solid #ffd27a; outline-offset: -6px; }
.cabinet[aria-expanded="true"] { translate: 0 120%; }

.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 30; width: min(400px, 92vw); display: flex; flex-direction: column;
  background: linear-gradient(90deg, #262a25, #343932 8%, #2f342e 92%, #23271f);
  box-shadow: -20px 0 60px rgba(0,0,0,.7); translate: 100% 0; transition: translate .4s cubic-bezier(.25,.8,.3,1); }
.drawer.open { translate: 0 0; }
.drawer[hidden] { display: none; }
.drawer-in { flex: 1; overflow: auto; overscroll-behavior: contain; padding: max(14px, env(safe-area-inset-top)) 18px max(24px, env(safe-area-inset-bottom)) 22px;
  background: repeating-linear-gradient(90deg, rgba(0,0,0,0) 0 22px, rgba(0,0,0,.12) 22px 24px); }
.files { list-style: none; margin: 0; padding: 0; display: grid; gap: 30px; }
.files li { position: relative; }
.file { position: relative; display: block; width: 100%; height: 50px; text-align: left; border: 0; padding: 10px 14px 0; margin: 0; cursor: pointer;
  background: linear-gradient(180deg, #e2c58c 0%, #d5b475 60%, #c8a463 100%); color: var(--type); border-radius: 2px 2px 0 0;
  box-shadow: 0 -2px 6px rgba(0,0,0,.35), 0 6px 10px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.35); transition: translate .18s ease; }
.file .t { position: absolute; top: -27px; height: 28px; max-width: calc(100% - 20px); padding: 4px 8px 0; border-radius: 6px 6px 0 0;
  background: linear-gradient(#e8cc95, #dcbd80); box-shadow: 0 -1px 3px rgba(0,0,0,.3); }
.file .t span { display: block; padding: 2px 8px 1px; background: #fbf8ef; font: 15px/18px var(--typewriter); color: #2a2622; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); }
.files li:nth-child(3n+1) .file .t { left: 10px; }
.files li:nth-child(3n+2) .file .t { left: 26%; }
.files li:nth-child(3n) .file .t { right: 10px; }
.file .c { display: block; font: 12px/1.2 var(--courier); letter-spacing: .1em; opacity: .62; }
.files li:nth-child(3n) .file .c { text-align: left; }
.file:hover, .file:focus-visible { translate: 0 -5px; }
.file:focus-visible { outline: 3px solid #1b1a1c; outline-offset: -3px; }
.files li:first-child { margin-top: 34px; }

/* ---------------- the case file (a manila folder around the kit) */
.case { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; }
.case[hidden] { display: none; }
.case-back { position: absolute; inset: 0; background: rgba(6,4,2,.74); opacity: 0; transition: opacity .3s ease; }
.case.open .case-back { opacity: 1; }
.folder { position: relative; width: min(1040px, calc(100vw - 40px)); height: calc(100vh - 78px); height: calc(100svh - 78px); margin-top: 38px;
  background: linear-gradient(180deg, #e2c389 0%, var(--manila) 40%, #d2b071 100%); border-radius: 0 10px 8px 8px; color: var(--type);
  box-shadow: 0 30px 80px rgba(0,0,0,.65), inset 0 1px 0 rgba(255,255,255,.35); display: flex; flex-direction: column;
  translate: 0 40px; rotate: -.6deg; opacity: 0; transition: translate .38s cubic-bezier(.2,.8,.25,1), rotate .38s ease, opacity .25s ease; }
.case.open .folder { translate: 0 0; rotate: 0deg; opacity: 1; }
.folder-tab { position: absolute; left: 0; top: -36px; height: 38px; max-width: min(78%, 620px); padding: 6px 16px 0 14px; border-radius: 8px 10px 0 0;
  background: linear-gradient(180deg, #e7cb93, #e0c288); box-shadow: 0 -2px 4px rgba(0,0,0,.18); }
.label { display: flex; align-items: baseline; gap: 12px; min-width: 0; padding: 4px 12px 3px; background: #fbf8ef; box-shadow: inset 0 0 0 1px rgba(0,0,0,.07), 0 1px 1px rgba(0,0,0,.15); }
.label b { font: 400 20px/1.15 var(--typewriter); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.label i { font: 400 12px/1 var(--courier); letter-spacing: .1em; white-space: nowrap; font-style: normal; opacity: .75; }
.case-close { position: absolute; top: 10px; right: 10px; z-index: 2; width: 44px; height: 44px; border: 0; border-radius: 50%; display: grid; place-items: center;
  background: rgba(39,35,31,.88); color: #f5efe0; cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,.4); }
.case-close:focus-visible { outline: 3px solid #1b1a1c; outline-offset: 2px; }
.folder-body { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 18px 18px 22px; -webkit-overflow-scrolling: touch; }
.folder-body:focus { outline: none; }
.sheet { position: relative; min-height: 100%; padding: 30px 36px 40px; background: #fcfbf7; color: var(--type);
  box-shadow: 0 2px 8px rgba(70,45,10,.35), 4px 6px 0 -1px #f4f1ea, 4px 6px 4px -1px rgba(70,45,10,.25); }
.clipped { position: relative; margin: 0 0 26px; width: min(100%, 440px); padding: 9px 9px 9px; background: var(--paper); rotate: -1.4deg;
  box-shadow: 0 3px 10px rgba(0,0,0,.28); }
.clipped img { display: block; width: 100%; height: auto; }
.clip { position: absolute; top: -18px; left: 36px; width: 24px; height: 62px; border: 3px solid #9ea3a6; border-radius: 12px; border-bottom-color: #8b9093;
  box-shadow: 1px 1px 2px rgba(0,0,0,.25); }
.clip::after { content: ''; position: absolute; left: 3px; top: 8px; width: 12px; height: 38px; border: 3px solid #b7bcbf; border-top: 0; border-radius: 0 0 8px 8px; }

#case-media { --ab-fg: var(--type); --ab-muted: #5d554b; --ab-accent: #1b1a1c; --ab-chrome: 150px; font: 16px/1.55 var(--courier); }
#case-media .ab-lede { font: 18px/1.5 var(--courier); max-width: 62ch; }
#case-media .ab-heading { font: 400 19px/1.25 var(--typewriter); letter-spacing: .02em; padding-top: 6px; border-top: 1px dashed rgba(39,35,31,.25); }
#case-media .ab-text { max-width: 66ch; }
#case-media .ab-credits { font: 13px/1.6 var(--courier); letter-spacing: .02em; padding-top: 12px; border-top: 1px dashed rgba(39,35,31,.25); }
#case-media figcaption { font: 13px/1.3 var(--typewriter); color: #5d554b; }
#case-media .ab-image img { box-shadow: 0 2px 8px rgba(0,0,0,.18); }
.case-cards { display: flex; flex-wrap: wrap; gap: 16px 18px; margin-top: 30px; padding-top: 22px; border-top: 1px dashed rgba(39,35,31,.25); }
.case-cards .card { position: relative; min-width: 150px; height: auto; min-height: 78px; padding: 22px 14px 8px; rotate: var(--r, 0deg);
  background:
    linear-gradient(#e3797a, #e3797a) 0 16px / 100% 2px no-repeat,
    repeating-linear-gradient(180deg, rgba(0,0,0,0) 0 14px, #b3cde3 14px 15px) 0 19px / 100% calc(100% - 19px) no-repeat,
    linear-gradient(170deg, #fdfbf4, #f2eee2);
  box-shadow: 0 3px 6px rgba(0,0,0,.25); }
.case-cards .card .ink { font-size: 19px; }
.case-cards .card::before { content: ''; position: absolute; top: 5px; left: 50%; width: 11px; height: 11px; margin-left: -5.5px; border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #ff9a90 0 10%, #c8161e 35%, #5e0508 100%); }

/* ---------------- sound */
.sound { position: fixed; left: max(12px, env(safe-area-inset-left)); bottom: max(12px, env(safe-area-inset-bottom)); z-index: 25; width: 40px; height: 40px;
  border: 0; border-radius: 50%; display: grid; place-items: center; background: rgba(20,17,14,.62); color: #e9dcc6; cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(255,235,200,.14); }
.sound .waves { display: none; }
.sound[aria-pressed="true"] .waves { display: inline; }
.sound[aria-pressed="true"] .mute { display: none; }
.sound:focus-visible { outline: 3px solid #ffd27a; outline-offset: 2px; }

/* ---------------- loading: one pin, one length of yarn */
#loader { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: #0b0907; transition: opacity .5s ease; }
#loader .ld { width: min(420px, 78vw); height: auto; overflow: visible; }
#loader.done { animation: lampOn .9s steps(1, end) forwards; }
@keyframes lampOn { 0% { opacity: 1; } 18% { opacity: .35; } 30% { opacity: .85; } 42% { opacity: .12; } 60% { opacity: .0; } 100% { opacity: 0; visibility: hidden; } }
#loader.gone { display: none; }

/* ---------------- phones */
@media (max-width: 720px) {
  .cabinet { width: 186px; height: 120px; right: -36px; bottom: -22px; scale: .78; }
  .folder { width: calc(100vw - 12px); height: calc(100vh - 52px); height: calc(100svh - 52px); margin-top: 40px; border-radius: 0 8px 4px 4px; }
  .folder-tab { top: -34px; max-width: calc(100% - 58px); padding: 6px 10px 0 8px; }
  .label { gap: 8px; padding: 4px 8px 3px; }
  .label b { font-size: 17px; }
  .label i { display: none; }
  .case-close { top: 6px; right: 6px; }
  .folder-body { padding: 8px 6px 12px; }
  .sheet { padding: 22px 14px 30px; }
  .clipped { width: min(100%, 320px); margin-bottom: 20px; }
  #case-media { --ab-chrome: 116px; font-size: 15px; }
  #case-media .ab-lede { font-size: 16px; }
  .case-cards { gap: 14px 12px; }
  .case-cards .card { min-width: 0; flex: 1 1 140px; padding-left: 9px; padding-right: 9px; }
}
@media (prefers-reduced-motion: reduce) {
  .folder, .drawer, .cabinet { transition: none; }
}
