/* The Archive */
:root { --ink: #efe6d2; --muted: #c4b694; --brass: #d9b064; --amber: #e2a640; --bg: #0a0806; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); overflow: hidden; -webkit-tap-highlight-color: transparent; }
body { font-family: 'Special Elite', 'Courier New', ui-monospace, monospace; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px dashed var(--brass); outline-offset: 3px; }

/* ---------------- loading: the door, while the clock is set */
#loader { position: fixed; inset: 0; z-index: 100; background: #060403; display: grid; place-items: center; transition: opacity .9s ease; }
#loader.gone { opacity: 0; pointer-events: none; }
.door { position: relative; width: min(330px, 64vw); aspect-ratio: 3 / 5; border-radius: 3px;
  background: linear-gradient(90deg, rgba(0,0,0,.35), transparent 8%, transparent 92%, rgba(0,0,0,.4)),
    repeating-linear-gradient(90deg, #2a1c12 0 2px, #33231a 2px 9px, #2c1d13 9px 13px), #2d1f15;
  box-shadow: 0 0 0 10px #17100b, 0 0 0 12px #3a2a1c, 0 30px 80px rgba(0,0,0,.8); display: flex; flex-direction: column; align-items: center; }
.door .led.big { width: 66%; margin-top: 16%; background: #120606; padding: 6px 8px; border: 4px solid #262626; border-radius: 3px; }
.plaque { margin-top: 26%; padding: 10px 16px; background: linear-gradient(160deg, #f3d58f, #b08433 55%, #7a5a22); color: #2b1d0b; font: 700 clamp(14px, 4vw, 19px)/1 'Stardos Stencil', 'Special Elite', serif; letter-spacing: .14em; border-radius: 2px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 3px 6px rgba(0,0,0,.6); }
.door-gap { position: absolute; left: 0; right: 0; bottom: -12px; height: 6px; overflow: hidden; }
.door-gap i { display: block; height: 100%; background: linear-gradient(90deg, transparent, #ffcf86 20%, #ffd99a 80%, transparent); transform-origin: 0 50%; transform: scaleX(0); transition: transform .3s; filter: blur(1px); }

/* ---------------- the LED clock */
svg.led { display: block; width: 100%; height: 100%; filter: drop-shadow(0 0 3px rgba(255, 50, 25, .75)); }
svg.led .on { fill: #ff3b22; }
svg.led .off { fill: rgba(255, 60, 30, .07); }
svg.led.blink .on { animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: .08; } }

/* ---------------- the room, desktop: one painted wall, scaled to fit */
#room { position: fixed; inset: 0; overflow: hidden; }
.desk-view .bleed { position: absolute; inset: -60px; background: url(art/room-1280.webp) center / cover; filter: blur(30px) brightness(.32); }
.scene { position: absolute; left: 0; top: 0; width: 1280px; height: 800px; transform-origin: 0 0; --ux: 640px; --uy: 420px; }
.paint { position: absolute; inset: 0; width: 1280px; height: 800px; display: block; user-select: none; -webkit-user-drag: none; pointer-events: none; }
.light { position: absolute; inset: 0; pointer-events: none; z-index: 8;
  background: radial-gradient(ellipse 75% 70% at 50% 38%, transparent 55%, rgba(0,0,0,.42) 100%), linear-gradient(180deg, transparent 70%, rgba(0,0,0,.2) 92%); }
.box { position: absolute; padding: 0; margin: 0; border: 0; background: transparent; cursor: pointer; border-radius: 3px; }
.box .label { position: absolute; display: block; object-fit: cover; user-select: none; -webkit-user-drag: none; pointer-events: none;
  filter: sepia(.14) saturate(.96) brightness(var(--lit, .94)); transition: filter .25s; box-shadow: 0 0 0 .5px rgba(0,0,0,.35); }
.box .label.portrait { box-shadow: 0 0 0 2px #e6dccb, 0 1px 3px rgba(0,0,0,.6); }
.box[data-row="1"] { --lit: .9; } .box[data-row="2"] { --lit: .86; } .box[data-row="3"] { --lit: .8; }
.box .shade { position: absolute; pointer-events: none; background: linear-gradient(180deg, rgba(255,214,160,.05), rgba(30,16,4,.16)); mix-blend-mode: multiply; }
.box:hover .label, .box:focus-visible .label { filter: sepia(.05) brightness(1.06); }
.box:hover::after, .box:focus-visible::after { content: ''; position: absolute; inset: -6px; border-radius: 8px; pointer-events: none; box-shadow: 0 0 22px 4px rgba(255, 200, 120, .16); }
.box .hang { position: absolute; display: block; pointer-events: none; filter: drop-shadow(0 1.5px 1px rgba(0,0,0,.7)); }
.box .hang svg { width: 100%; height: 100%; display: block; transform-origin: 30% 20%; transition: transform .4s; }
.box.is-open .hang svg { transform: rotate(-24deg) translate(-8%, 6%); }
.box .tag { position: absolute; left: 50%; top: -15px; transform: translateX(-50%) rotate(-1.5deg); padding: 2px 8px 1px; background: #dccfa8; color: #2a1e14; font: 12px/1.2 'Permanent Marker', cursive;
  white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .15s; z-index: 12; box-shadow: 0 2px 4px rgba(0,0,0,.5); }
.box:hover .tag, .box:focus-visible .tag { opacity: 1; }
.ledbox { position: absolute; left: 576px; top: 16px; width: 132px; height: 46px; background: #110505; border-radius: 2px; box-shadow: inset 0 0 8px #000; }
.exit { position: absolute; left: 1049px; top: 9px; width: 103px; height: 43px; border: 0; padding: 0; cursor: pointer; background: rgba(40, 170, 95, .28);
  color: #eafff1; font: 700 25px/43px 'Helvetica Neue', Arial, sans-serif; letter-spacing: .16em; text-indent: .16em; text-shadow: 0 0 6px #6dffaa, 0 0 14px rgba(80, 255, 150, .6); }
.exit:hover { background: rgba(60, 200, 115, .38); }
.camled { position: absolute; left: 136px; top: 26px; width: 3px; height: 3px; border-radius: 50%; background: #ff2a1a; box-shadow: 0 0 5px 2px rgba(255, 30, 10, .8); animation: blink 2s steps(1) infinite; pointer-events: none; }
.prop { position: absolute; border: 0; padding: 0; background: transparent; cursor: pointer; border-radius: 6px; z-index: 9; }
.prop:hover, .prop:focus-visible { box-shadow: 0 0 0 1.5px rgba(255, 214, 150, .45), 0 0 18px rgba(255, 200, 120, .25); }
.p-binder .staff { position: absolute; left: 30%; top: 22%; transform: rotate(-3deg); background: #ebe3cd; color: #a8241a; font: 8.5px/1 'Permanent Marker', cursive; padding: 2px 4px; white-space: nowrap; pointer-events: none; box-shadow: 0 1px 2px rgba(0,0,0,.6); }
.scene .caption { position: absolute; left: 40px; top: 742px; width: 680px; z-index: 15; }
.caption { pointer-events: none; padding: 7px 12px 7px 34px; background: rgba(10, 8, 6, .8); border-left: 3px solid var(--amber); color: #f6ead0; font-size: 15px; line-height: 1.35;
  opacity: 0; transform: translateY(4px); transition: opacity .25s, transform .25s; border-radius: 2px; }
.caption::before { content: ''; position: absolute; left: 12px; top: 50%; width: 12px; height: 12px; margin-top: -6px; border-radius: 50%; border: 2px solid var(--amber); border-left-color: transparent; border-bottom-color: transparent; transform: rotate(45deg); opacity: .8; }
.caption.on { opacity: 1; transform: none; }

/* black light, in the room */
.uvroom { position: absolute; inset: 0; z-index: 20; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(circle at var(--ux) var(--uy), rgba(150, 90, 255, .1) 0, rgba(70, 25, 150, .5) 110px, rgba(6, 2, 16, .9) 170px); }
.uv .uvroom { opacity: 1; }
.uvink { position: absolute; z-index: 30; display: flex; align-items: center; justify-content: center; text-align: center; padding: 4%; pointer-events: none;
  font-family: 'Permanent Marker', cursive; line-height: 1.05; color: #d6fbff; text-shadow: 0 0 4px #9ff4ff, 0 0 12px #5fd4ff, 0 0 24px #8e6bff;
  transform: rotate(-7deg); opacity: 0; transition: opacity .25s; }
.uv .uvink { opacity: 1; }
@media (hover: hover) {
  .scene .uvink { -webkit-mask-image: radial-gradient(circle 120px at calc(var(--ux) - var(--bx, 0px)) calc(var(--uy) - var(--by, 0px)), #000 45%, transparent 100%);
    mask-image: radial-gradient(circle 120px at calc(var(--ux) - var(--bx, 0px)) calc(var(--uy) - var(--by, 0px)), #000 45%, transparent 100%); }
}
@media (hover: none) { .uvroom { background: rgba(14, 5, 34, .82); } }
.uv .box .label { filter: brightness(.25) saturate(.4); }

/* ---------------- the room, phone: the shelves scroll */
.phone-view { overflow-y: auto !important; overflow-x: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  background: repeating-linear-gradient(90deg, #1a120c 0 1px, #23180f 1px 34px, #1d140d 34px 36px, #261a11 36px 70px); }
.wall { position: sticky; top: 0; z-index: 25; height: 64px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, #0b0d0a, #141611); box-shadow: 0 6px 16px rgba(0,0,0,.7); padding-top: env(safe-area-inset-top); }
.wall .ledbox { position: relative; left: auto; top: auto; width: 124px; height: 43px; border: 3px solid #2b2b2b; }
.wall .exit { position: absolute; left: auto; right: 12px; top: 50%; margin-top: -17px; width: 66px; height: 34px; font-size: 17px; line-height: 34px; border-radius: 2px; box-shadow: 0 0 0 3px #3b3d39; }
.wall .cam { position: absolute; left: 14px; top: 50%; margin-top: -11px; width: 22px; height: 22px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #f2f2f2, #a9a9a9 60%, #555); }
.wall .cam::after { content: ''; position: absolute; right: 2px; bottom: 3px; width: 4px; height: 4px; border-radius: 50%; background: #ff2a1a; box-shadow: 0 0 5px 2px rgba(255,30,10,.8); animation: blink 2s steps(1) infinite; }
.shelves { display: grid; grid-template-columns: repeat(2, auto); justify-content: center; gap: 0 10px; padding: 14px 12px calc(100px + env(safe-area-inset-bottom)); }
.tile { position: relative; background-image: url(art/room.webp); background-repeat: no-repeat; }
.tile .box .tag { display: none; }
.tilename { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); max-width: 98%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; pointer-events: none;
  font: 10.5px/1.25 'Permanent Marker', cursive; color: #2b1f14; background: #d9cca5; padding: 0 6px; box-shadow: 0 1px 2px rgba(0,0,0,.6); }
.phone-view .uvroom { position: fixed; }
.phone-view.uv::after { content: ''; position: fixed; inset: 0; z-index: 20; pointer-events: none; background: rgba(14, 5, 34, .82); }
.deskbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 26; height: calc(78px + env(safe-area-inset-bottom)); padding: 8px 14px env(safe-area-inset-bottom);
  display: flex; align-items: center; gap: 14px; background: url(art/room-1280.webp) 32% 100% / 380vw auto no-repeat, #2a1a10; box-shadow: 0 -8px 18px rgba(0,0,0,.6); }
.dk { position: relative; border: 0; padding: 0; background-color: transparent; cursor: pointer; flex: none; }
.dk-binder { width: 92px; height: 48px; border-radius: 4px; background: linear-gradient(170deg, #2a2a2a, #121212 60%, #1d1d1d); box-shadow: inset 0 1px 0 rgba(255,255,255,.12), inset 6px 0 0 #0b0b0b, 0 4px 8px rgba(0,0,0,.6); transform: rotate(-3deg); }
.dk-binder .staff { position: absolute; left: 22px; top: 14px; background: #ebe3cd; color: #a8241a; font: 10px/1 'Permanent Marker', cursive; padding: 3px 5px; transform: rotate(-2deg); white-space: nowrap; }
.dk-flash { width: 64px; height: 22px; border-radius: 4px 11px 11px 4px; background: linear-gradient(180deg, #4a4a4a, #151515 60%, #2b2b2b); box-shadow: 0 3px 6px rgba(0,0,0,.6); }
.dk-flash::after { content: ''; position: absolute; right: -3px; top: 2px; width: 8px; height: 18px; border-radius: 3px; background: linear-gradient(90deg, #6d6d6d, #b8b8c8); }
.uv .dk-flash::after { background: #b07bff; box-shadow: 0 0 14px 6px rgba(150, 90, 255, .7); }
.dk-walkie { margin-left: auto; width: 44px; height: 66px; background: url(art/walkie.webp) center / contain no-repeat; filter: drop-shadow(0 4px 6px rgba(0,0,0,.7)); }
.deskbar .caption { position: absolute; left: 12px; right: 12px; bottom: calc(100% + 8px); }

/* ---------------- a box, up close */
#close { position: fixed; inset: 0; z-index: 40; background: rgba(6, 4, 3, .9); display: grid; place-items: center; overflow: auto; }
.cu { display: grid; grid-template-columns: auto auto; grid-template-areas: 'tag tag' 'box lock' 'bar bar'; gap: 18px 34px; align-items: center; justify-items: center; padding: 22px; max-width: 100%; opacity: 0; transform: scale(.97); transition: opacity .25s, transform .25s; }
#close.in .cu { opacity: 1; transform: none; }
.cu-tag { grid-area: tag; display: flex; flex-direction: column; align-items: center; gap: 2px; transform: rotate(-1deg); background: #dccfa8; color: #2a1e14; padding: 4px 16px 3px; box-shadow: 0 3px 8px rgba(0,0,0,.6); }
.cu-tag b { font: 22px/1.1 'Permanent Marker', cursive; font-weight: 400; }
.cu-tag span { font-size: 11px; letter-spacing: .14em; opacity: .75; }
.cu-box { grid-area: box; position: relative; background-image: url(art/room.webp); background-repeat: no-repeat; border-radius: 4px; box-shadow: 0 30px 70px rgba(0,0,0,.75); --ux: 50%; --uy: 50%; touch-action: manipulation; }
.cu-print { position: absolute; padding: 0; border: 0; background: transparent; cursor: zoom-in; }
.cu-print img { width: 100%; height: 100%; display: block; object-fit: contain; filter: sepia(.08); }
.cu-print img.portrait { box-shadow: 0 0 0 3px #e6dccb; }
.loupe { position: absolute; right: -11px; bottom: -11px; width: 28px; height: 28px; border-radius: 50%; background: #dccfa8; box-shadow: 0 2px 5px rgba(0,0,0,.6); pointer-events: none; }
.loupe::before { content: ''; position: absolute; left: 6px; top: 6px; width: 10px; height: 10px; border: 2.4px solid #2a1e14; border-radius: 50%; }
.loupe::after { content: ''; position: absolute; left: 17px; top: 17px; width: 7px; height: 2.6px; background: #2a1e14; transform: rotate(45deg); transform-origin: 0 50%; border-radius: 2px; }
.cu-box .hang { position: absolute; pointer-events: none; filter: drop-shadow(0 2px 2px rgba(0,0,0,.7)); }
.cu-box .hang svg { width: 100%; height: 100%; display: block; }
.cu-box .beam { position: absolute; inset: 0; z-index: 5; pointer-events: none; border-radius: 4px; opacity: 0; transition: opacity .25s;
  background: radial-gradient(circle at var(--ux) var(--uy), rgba(150, 90, 255, .12) 0, rgba(70, 25, 150, .5) 120px, rgba(6, 2, 16, .9) 190px); }
.cu-box.uv .beam { opacity: 1; }
.cu-box.uv { touch-action: none; cursor: none; }
.cu-box.uv .cu-print { cursor: none; }
.cu-box .uvink { z-index: 6; -webkit-mask-image: radial-gradient(circle 150px at calc(var(--ux) - var(--bx, 0px)) calc(var(--uy) - var(--by, 0px)), #000 40%, transparent 100%);
  mask-image: radial-gradient(circle 150px at calc(var(--ux) - var(--bx, 0px)) calc(var(--uy) - var(--by, 0px)), #000 40%, transparent 100%); }
.cu-box.uv .uvink { opacity: 1; }
.cu-lock { grid-area: lock; display: flex; align-items: center; justify-content: center; min-width: 260px; padding: 30px 0 10px; }
.cu-bar { grid-area: bar; display: flex; align-items: center; gap: 16px; width: 100%; max-width: 980px; position: relative; }
.cu-back { width: 48px; height: 48px; border-radius: 50%; border: 0; background: #2a2119; color: #e9dcc0; font-size: 28px; line-height: 48px; cursor: pointer; box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 3px 8px rgba(0,0,0,.6); flex: none; }
.cu-flash { position: relative; width: 74px; height: 26px; border: 0; padding: 0; border-radius: 4px 13px 13px 4px; cursor: pointer; flex: none;
  background: linear-gradient(180deg, #4a4a4a, #151515 60%, #2b2b2b); box-shadow: 0 3px 6px rgba(0,0,0,.6); }
.cu-flash::after { content: ''; position: absolute; right: -4px; top: 2px; width: 10px; height: 22px; border-radius: 4px; background: linear-gradient(90deg, #6d6d6d, #b8b8c8); }
.cu-flash[aria-pressed="true"]::after { background: #b07bff; box-shadow: 0 0 16px 8px rgba(150, 90, 255, .7); }
.cu-bar .caption { flex: 1; position: relative; min-height: 46px; display: flex; align-items: center; }
.cu-walkie { position: relative; width: 58px; height: 88px; border: 0; padding: 0; cursor: pointer; flex: none; background: url(art/walkie.webp) center / contain no-repeat; filter: drop-shadow(0 4px 8px rgba(0,0,0,.7)); transition: transform .12s; }
.cu-walkie:active { transform: scale(.95); }
.cu-walkie .ptt { position: absolute; left: -2px; top: 40%; width: 6px; height: 18%; border-radius: 3px; background: #e2a640; box-shadow: 0 0 8px rgba(226,166,64,.7); }
.cu-walkie .hl { position: absolute; left: 30%; right: 22%; top: 58%; height: 9%; display: flex; gap: 3px; align-items: center; justify-content: center; }
.cu-walkie .hl b { width: 5px; height: 5px; border-radius: 50%; background: #233; }
.cu-walkie .hl b.used { background: #7dff9b; box-shadow: 0 0 4px #7dff9b; }
.cu.unlocked .cu-lock .lk { animation: drop .8s .25s ease-in forwards; }
@keyframes drop { 30% { transform: rotate(-8deg); } 100% { transform: translateY(40px) rotate(-18deg); opacity: 0; } }

/* ---------------- locks */
.lk { position: relative; display: flex; flex-direction: column; align-items: center; user-select: none; -webkit-user-select: none; }
.lk .shackle { width: 62%; max-width: 170px; height: 92px; margin-bottom: -26px; border: 17px solid #b9bfc4; border-bottom: 0; border-radius: 90px 90px 0 0; transition: transform .35s cubic-bezier(.3, 1.6, .5, 1);
  box-shadow: inset 0 3px 2px rgba(255,255,255,.4), 0 2px 0 rgba(0,0,0,.3); position: relative; z-index: 0; }
.lk.open .shackle { transform: translateY(-30px); }
.lk .body { position: relative; z-index: 1; border-radius: 20px; padding: 26px 20px 22px; box-shadow: inset 0 2px 0 rgba(255,255,255,.55), inset 0 -8px 16px rgba(0,0,0,.35), 0 22px 40px rgba(0,0,0,.6); }
.lk.brass .body, .lk-dir.brass .body { background: linear-gradient(165deg, #f6dc98, #c99b44 38%, #8a6526 75%, #c9a35a); }
.lk.steel .body { background: linear-gradient(165deg, #f2f4f6, #a7aeb5 38%, #5e656c 75%, #b9bfc5); }
.lk.brass .shackle { border-color: #c8ccd0; }
.wheels { display: flex; gap: 5px; padding: 7px 8px; border-radius: 9px; background: #151311; box-shadow: inset 0 3px 9px rgba(0,0,0,.85), 0 1px 0 rgba(255,255,255,.35); }
.wheel { position: relative; width: 46px; height: 100px; overflow: hidden; border-radius: 5px; cursor: ns-resize; touch-action: none; outline-offset: 2px;
  background: linear-gradient(180deg, #161616, #6c6c6c 17%, #dedede 48%, #f2f2f2 52%, #6c6c6c 83%, #161616); }
.brass .wheel { background: linear-gradient(180deg, #2a1d08, #8f6a28 17%, #f0cf86 48%, #fbe2a6 52%, #8f6a28 83%, #2a1d08); }
.wheel::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(0,0,0,.55), transparent 30%, transparent 70%, rgba(0,0,0,.55)); }
.wheel:focus-visible { outline: 2px solid #ffd27a; }
.strip { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; align-items: center; }
.cell { display: flex; align-items: center; justify-content: center; height: 34px; width: 100%; font: 700 27px/1 'Helvetica Neue', Arial, sans-serif; color: #191613; text-shadow: 0 1px 0 rgba(255,255,255,.55); opacity: .5; transform: scaleY(.78); }
.cell.cur { opacity: 1; transform: none; }
.cell.dot::before { content: ''; width: 24px; height: 24px; border-radius: 50%; background: var(--c); box-shadow: inset 0 -3px 5px rgba(0,0,0,.35), inset 0 2px 3px rgba(255,255,255,.35), 0 1px 1px rgba(0,0,0,.4); }
.lk[data-type="symbol"] .cell { font-size: 26px; font-family: 'Segoe UI Symbol', 'Apple Symbols', 'Noto Sans Symbols 2', sans-serif; }
.strip.roll-up { animation: rollUp .13s ease-out; }
.strip.roll-down { animation: rollDown .13s ease-out; }
@keyframes rollUp { from { transform: translateY(calc(-50% + 34px)); } }
@keyframes rollDown { from { transform: translateY(calc(-50% - 34px)); } }
/* the cryptex */
.lk-cryptex { flex-direction: row; }
.lk-cryptex .body { padding: 0; border-radius: 6px; background: none !important; box-shadow: 0 22px 40px rgba(0,0,0,.6); }
.lk-cryptex .wheels { gap: 0; padding: 0; border-radius: 0; background: #1b140a; }
.lk-cryptex .wheel { width: 44px; height: 116px; border-radius: 0; border-left: 2px solid #3b2a10; }
.lk-cryptex.steel .wheel { border-left-color: #2b2f33; }
.lk-cryptex .cap { display: block; width: 40px; height: 132px; border-radius: 16px; background: linear-gradient(180deg, #2a1d08, #9a7330 18%, #f7d895 48%, #9a7330 82%, #2a1d08); box-shadow: 0 18px 30px rgba(0,0,0,.5); position: relative; z-index: 2; }
.lk-cryptex.steel .cap { background: linear-gradient(180deg, #161616, #757b80 18%, #f0f2f4 48%, #757b80 82%, #161616); }
.lk-cryptex .cap-l { margin-right: -6px; } .lk-cryptex .cap-r { margin-left: -6px; }
.lk-cryptex.open .cap-r { transform: translateX(26px); transition: transform .5s; }
/* the safe keypad */
.lk-keypad .body { width: 250px; padding: 18px; border-radius: 10px; background: linear-gradient(160deg, #6b7076, #3c4045 45%, #2a2d31); display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; outline: none; }
.kp-screen { background: #0b170d; color: #7dff98; font: 700 28px/1 'Courier New', monospace; letter-spacing: .2em; text-align: center; padding: 10px 6px; border-radius: 4px; box-shadow: inset 0 2px 8px #000; text-shadow: 0 0 8px rgba(125, 255, 152, .6); }
.kp-led { width: 12px; height: 12px; border-radius: 50%; background: #3b0c0c; box-shadow: inset 0 1px 2px #000; }
.kp-led.ok { background: #5dff7f; box-shadow: 0 0 10px #5dff7f; } .kp-led.no { background: #ff3b30; box-shadow: 0 0 10px #ff3b30; }
.kp-grid { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.kp-key { height: 50px; border: 0; border-radius: 7px; cursor: pointer; background: linear-gradient(180deg, #62666b, #33363a); color: #eef0f2; font: 700 21px/1 'Helvetica Neue', Arial, sans-serif; box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 3px 0 #17191b; }
.kp-key:active { transform: translateY(2px); box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 1px 0 #17191b; }
/* the directional lock */
.lk-dir .body { width: 250px; height: 250px; border-radius: 50%; padding: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; outline: none; }
.lk-dir .shackle { margin-bottom: -40px; }
.dir-face { position: relative; width: 168px; height: 168px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #2b2b2b, #0f0f0f); box-shadow: inset 0 4px 10px rgba(0,0,0,.9), 0 1px 0 rgba(255,255,255,.4); }
.dir-knob { position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px; border-radius: 50%; background: radial-gradient(circle at 38% 32%, #f3f5f7, #9aa1a8 55%, #555b61); box-shadow: 0 4px 8px rgba(0,0,0,.7); transition: transform .12s; touch-action: none; cursor: grab; }
.dir-knob[data-d="U"] { transform: translateY(-16px); } .dir-knob[data-d="D"] { transform: translateY(16px); } .dir-knob[data-d="L"] { transform: translateX(-16px); } .dir-knob[data-d="R"] { transform: translateX(16px); }
.dir-btn { position: absolute; width: 44px; height: 44px; border: 0; background: transparent; color: #d7d7d7; font: 700 22px/44px 'Helvetica Neue', Arial, sans-serif; cursor: pointer; }
.dir-up { left: 62px; top: 2px; } .dir-down { left: 62px; bottom: 2px; } .dir-left { left: 2px; top: 62px; } .dir-right { right: 2px; top: 62px; }
.dir-btn:hover { color: #fff; }
.dir-dots { height: 22px; margin-top: 8px; font: 700 18px/22px 'Helvetica Neue', Arial, sans-serif; color: #2a1e10; letter-spacing: .1em; }
.dir-reset { position: absolute; bottom: -42px; border: 0; background: transparent; color: var(--muted); font-size: 13px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* ---------------- the lid: the case study */
#lid { position: fixed; inset: 0; z-index: 60; background: rgba(4, 3, 2, .86); display: grid; place-items: center; perspective: 1800px; }
.lid-frame { width: min(1120px, 96vw); height: min(94vh, 100%); display: flex; flex-direction: column; overflow: hidden;
  border: 30px solid transparent; border-image: url(art/lid.webp) 92 fill / 30px / 0 stretch; box-shadow: 0 30px 90px rgba(0,0,0,.8); transform-origin: 50% 100%; }
#lid.in .lid-frame { animation: lidUp .6s cubic-bezier(.2, .8, .2, 1); }
@keyframes lidUp { from { transform: rotateX(72deg) scale(.92); opacity: .2; } to { transform: none; opacity: 1; } }
.lid-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 6px 8px 12px 10px; flex: none; }
#lid-title { margin: 0; font: 700 clamp(26px, 3.4vw, 40px)/1.05 'Stardos Stencil', 'Special Elite', serif; color: #f0e3c1; letter-spacing: .02em; text-shadow: 0 2px 0 rgba(0,0,0,.5); }
#lid-client { margin: 4px 0 0; font-size: 12px; letter-spacing: .2em; color: #c6b78f; }
.lid-close { flex: none; width: 46px; height: 46px; border-radius: 50%; border: 0; background: rgba(0,0,0,.35); color: #f0e3c1; font-size: 30px; line-height: 46px; cursor: pointer; }
.lid-close:hover { background: rgba(0,0,0,.55); }
.lid-scroll { flex: 1; overflow: auto; padding: 0 10px 28px; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.lid-body { --ab-fg: #efe6d2; --ab-muted: #c9bb98; --ab-accent: #e7c27a; --ab-chrome: 150px; max-width: 980px; margin: 0 auto; font-size: 16px; line-height: 1.55; }
.lid-body .ab-lede { font-size: 18px; color: #f4ebd5; max-width: 760px; }
.lid-body .ab-heading { font: 700 19px/1.2 'Stardos Stencil', 'Special Elite', serif; letter-spacing: .05em; color: #e7d3a4; padding-top: 6px; border-top: 1px dashed rgba(231, 211, 164, .25); }
.lid-body .ab-credits { padding-top: 12px; border-top: 1px dashed rgba(231, 211, 164, .25); }
.lid-body .ab-frame { box-shadow: 0 8px 22px rgba(0,0,0,.55); }
.lid-body .ab-image img { box-shadow: 0 8px 22px rgba(0,0,0,.55); }
.lid-body audio { filter: sepia(.3) saturate(.8); }

/* ---------------- the binder */
#binder { position: fixed; inset: 0; z-index: 70; background: rgba(4, 3, 2, .86); display: grid; place-items: center; }
.book { position: relative; width: min(1180px, 96vw, 142vh); aspect-ratio: 1536 / 1024; background: url(art/binder.webp) center / 100% 100% no-repeat; filter: drop-shadow(0 30px 50px rgba(0,0,0,.7)); }
.page { position: absolute; display: flex; flex-direction: column; color: #1f1b16; overflow: hidden; }
.page.left { left: 13.2%; top: 15%; width: 31%; height: 67%; }
.page.right { left: 56.4%; top: 13.8%; width: 33.6%; height: 69%; }
.stamp { align-self: flex-start; margin: 0 0 6px 2px; padding: 3px 10px 1px; border: 3px solid #b3261e; color: #b3261e; font: 700 clamp(14px, 1.9vw, 26px)/1 'Stardos Stencil', serif; letter-spacing: .08em; transform: rotate(-5deg); opacity: .88; }
.page h3 { margin: 6px 0 0; font: 700 clamp(12px, 1.25vw, 17px)/1.2 'Special Elite', monospace; letter-spacing: .14em; }
.page .sub { margin: 0 0 8px; font-size: clamp(10px, 1vw, 13px); opacity: .7; }
.code-row { display: flex; align-items: baseline; width: 100%; padding: .22em 0; border: 0; background: transparent; text-align: left; cursor: pointer; font-size: clamp(9px, 1.08vw, 14px); color: #1f1b16; }
.code-row:hover .nm { text-decoration: underline; text-underline-offset: 2px; }
.code-row .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 62%; }
.code-row .dots { flex: 1; min-width: 8px; margin: 0 4px; border-bottom: 1.5px dotted rgba(0,0,0,.45); transform: translateY(-3px); }
.code-row .cd { white-space: nowrap; font-weight: 700; letter-spacing: .06em; }
.code-row .cd.sym { font-family: 'Helvetica Neue', Arial, 'Segoe UI Symbol', sans-serif; letter-spacing: .12em; }
.code-row.done .nm { text-decoration: line-through; text-decoration-color: rgba(30,90,40,.8); }
.b-close { position: absolute; top: max(12px, env(safe-area-inset-top)); right: 12px; width: 46px; height: 46px; border-radius: 50%; border: 0; background: rgba(255,255,255,.12); color: #f0e3c1; font-size: 30px; line-height: 46px; cursor: pointer; }

/* ---------------- outside: the About */
#about { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 20px; overflow: auto;
  background: radial-gradient(ellipse at 50% 30%, #f6eedc, #d8c9a6 70%, #bfae88); color: #231a12; animation: daylight .7s ease; }
@keyframes daylight { from { filter: brightness(2.2); opacity: .2; } }
#about .card { width: min(560px, 100%); padding: 34px 32px 28px; background: #fbf7ee; box-shadow: 0 20px 60px rgba(60, 40, 10, .35); border-top: 6px solid #2b2119; }
#about h2 { margin: 0 0 6px; font: 700 clamp(34px, 6vw, 48px)/1 'Stardos Stencil', serif; letter-spacing: .02em; }
#about .role { margin: 0 0 16px; font-size: 15px; letter-spacing: .06em; color: #5b4a35; }
#about .bio { margin: 0 0 14px; font-size: 17px; line-height: 1.5; }
#about .loc { margin: 0 0 20px; font-size: 14px; color: #5b4a35; }
#about .links { display: flex; flex-wrap: wrap; gap: 12px; margin: 0 0 22px; }
#about .links a { display: inline-block; padding: 11px 16px; background: #2b2119; color: #f6eedc; text-decoration: none; font-size: 15px; border-radius: 2px; }
#about .links a.li { background: transparent; color: #2b2119; box-shadow: inset 0 0 0 2px #2b2119; }
#about .back { border: 0; background: transparent; color: #5b4a35; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 6px 0; }

/* ---------------- the label, full size */
#zoom { position: fixed; inset: 0; z-index: 90; background: rgba(0, 0, 0, .95); }
.z-scroll { width: 100%; height: 100%; overflow: auto; display: grid; place-items: center; }
.z-scroll img { display: block; max-width: 96vw; max-height: 92vh; cursor: zoom-in; }
#zoom.big .z-scroll { display: block; }
#zoom.big .z-scroll img { max-width: none; max-height: none; width: max(1800px, 260vw); cursor: zoom-out; }
.z-close { position: fixed; top: max(12px, env(safe-area-inset-top)); right: 12px; width: 46px; height: 46px; border-radius: 50%; border: 0; background: rgba(255,255,255,.16); color: #fff; font-size: 30px; line-height: 46px; cursor: pointer; }

/* ---------------- phones */
@media (max-width: 760px), (max-aspect-ratio: 4/5) {
  #close { display: block; }
  .cu { grid-template-columns: 1fr; grid-template-areas: 'tag' 'box' 'lock'; gap: 14px; padding: 16px 12px calc(110px + env(safe-area-inset-bottom)); justify-items: center; }
  .cu-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 3; height: calc(92px + env(safe-area-inset-bottom)); padding: 8px 14px env(safe-area-inset-bottom); background: rgba(14, 10, 7, .97); box-shadow: 0 -8px 18px rgba(0,0,0,.6); max-width: none; }
  .cu-bar { gap: 10px; }
  .cu-bar .caption { position: relative; flex: 1; min-height: 0; max-height: 76px; overflow: hidden; font-size: 13px; line-height: 1.3; padding: 5px 8px 5px 26px; }
  .cu-bar .caption::before { left: 8px; width: 9px; height: 9px; margin-top: -5px; }
  .cu-back { width: 44px; height: 44px; line-height: 44px; }
  .cu-flash { width: 56px; }
  .cu-walkie { margin-left: auto; width: 52px; height: 78px; }
  .cu-lock { padding-top: 34px; min-width: 0; max-width: 100%; }
  .wheel { width: 42px; height: 96px; }
  .lk-cryptex .wheel { width: 38px; height: 104px; }
  .lk-cryptex .cap { width: 26px; height: 118px; }
  .lid-frame { width: 100vw; height: 100%; border-width: 16px; border-image-width: 16px; }
  .lid-head { padding: 8px 4px 10px 6px; }
  .lid-body { --ab-chrome: 130px; font-size: 15px; }
  .lid-body .ab-lede { font-size: 16px; }
  .book { width: 94vw; height: 88vh; aspect-ratio: auto; background: #f4efe2; border-left: 18px solid #151515; border-radius: 3px; overflow: auto; padding: 18px 14px 24px; }
  .page { position: static; width: auto !important; height: auto !important; overflow: visible; }
  .page.right { display: none; }
  .code-row { font-size: 14px; padding: .42em 0; }
  .code-row .nm { max-width: 64%; }
  .stamp { font-size: 22px; }
  .page h3 { font-size: 15px; } .page .sub { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
